Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103034615
D45867.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
13 KB
Referenced Files
None
Subscribers
None
D45867.diff
View Options
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -287,25 +287,25 @@
#define PRE7_COMPAT
typedef enum {
- PCI_GETCONF_NO_MATCH_OLD = 0x00,
- PCI_GETCONF_MATCH_BUS_OLD = 0x01,
- PCI_GETCONF_MATCH_DEV_OLD = 0x02,
- PCI_GETCONF_MATCH_FUNC_OLD = 0x04,
- PCI_GETCONF_MATCH_NAME_OLD = 0x08,
- PCI_GETCONF_MATCH_UNIT_OLD = 0x10,
- PCI_GETCONF_MATCH_VENDOR_OLD = 0x20,
- PCI_GETCONF_MATCH_DEVICE_OLD = 0x40,
- PCI_GETCONF_MATCH_CLASS_OLD = 0x80
-} pci_getconf_flags_old;
-
-struct pcisel_old {
+ PCI_GETCONF_NO_MATCH_FREEBSD6 = 0x00,
+ PCI_GETCONF_MATCH_BUS_FREEBSD6 = 0x01,
+ PCI_GETCONF_MATCH_DEV_FREEBSD6 = 0x02,
+ PCI_GETCONF_MATCH_FUNC_FREEBSD6 = 0x04,
+ PCI_GETCONF_MATCH_NAME_FREEBSD6 = 0x08,
+ PCI_GETCONF_MATCH_UNIT_FREEBSD6 = 0x10,
+ PCI_GETCONF_MATCH_VENDOR_FREEBSD6 = 0x20,
+ PCI_GETCONF_MATCH_DEVICE_FREEBSD6 = 0x40,
+ PCI_GETCONF_MATCH_CLASS_FREEBSD6 = 0x80
+} pci_getconf_flags_freebsd6;
+
+struct pcisel_freebsd6 {
u_int8_t pc_bus; /* bus number */
u_int8_t pc_dev; /* device on this bus */
u_int8_t pc_func; /* function on this device */
};
-struct pci_conf_old {
- struct pcisel_old pc_sel; /* bus+slot+function */
+struct pci_conf_freebsd6 {
+ struct pcisel_freebsd6 pc_sel; /* bus+slot+function */
u_int8_t pc_hdr; /* PCI header type */
u_int16_t pc_subvendor; /* card vendor ID */
u_int16_t pc_subdevice; /* card device ID, assigned by
@@ -321,26 +321,26 @@
u_long pd_unit; /* device unit number */
};
-struct pci_match_conf_old {
- struct pcisel_old pc_sel; /* bus+slot+function */
+struct pci_match_conf_freebsd6 {
+ struct pcisel_freebsd6 pc_sel; /* bus+slot+function */
char pd_name[PCI_MAXNAMELEN + 1]; /* device name */
u_long pd_unit; /* Unit number */
u_int16_t pc_vendor; /* PCI Vendor ID */
u_int16_t pc_device; /* PCI Device ID */
u_int8_t pc_class; /* PCI class */
- pci_getconf_flags_old flags; /* Matching expression */
+ pci_getconf_flags_freebsd6 flags; /* Matching expression */
};
-struct pci_io_old {
- struct pcisel_old pi_sel; /* device to operate on */
+struct pci_io_freebsd6 {
+ struct pcisel_freebsd6 pi_sel; /* device to operate on */
int pi_reg; /* configuration register to examine */
int pi_width; /* width (in bytes) of read or write */
u_int32_t pi_data; /* data to write or result of read */
};
#ifdef COMPAT_FREEBSD32
-struct pci_conf_old32 {
- struct pcisel_old pc_sel; /* bus+slot+function */
+struct pci_conf_freebsd6_32 {
+ struct pcisel_freebsd6 pc_sel; /* bus+slot+function */
uint8_t pc_hdr; /* PCI header type */
uint16_t pc_subvendor; /* card vendor ID */
uint16_t pc_subdevice; /* card device ID, assigned by
@@ -356,25 +356,25 @@
uint32_t pd_unit; /* device unit number (u_long) */
};
-struct pci_match_conf_old32 {
- struct pcisel_old pc_sel; /* bus+slot+function */
+struct pci_match_conf_freebsd6_32 {
+ struct pcisel_freebsd6 pc_sel; /* bus+slot+function */
char pd_name[PCI_MAXNAMELEN + 1]; /* device name */
uint32_t pd_unit; /* Unit number (u_long) */
uint16_t pc_vendor; /* PCI Vendor ID */
uint16_t pc_device; /* PCI Device ID */
uint8_t pc_class; /* PCI class */
- pci_getconf_flags_old flags; /* Matching expression */
+ pci_getconf_flags_freebsd6 flags; /* Matching expression */
};
-#define PCIOCGETCONF_OLD32 _IOWR('p', 1, struct pci_conf_io32)
+#define PCIOCGETCONF_FREEBSD6_32 _IOWR('p', 1, struct pci_conf_io32)
#endif /* COMPAT_FREEBSD32 */
-#define PCIOCGETCONF_OLD _IOWR('p', 1, struct pci_conf_io)
-#define PCIOCREAD_OLD _IOWR('p', 2, struct pci_io_old)
-#define PCIOCWRITE_OLD _IOWR('p', 3, struct pci_io_old)
+#define PCIOCGETCONF_FREEBSD6 _IOWR('p', 1, struct pci_conf_io)
+#define PCIOCREAD_FREEBSD6 _IOWR('p', 2, struct pci_io_freebsd6)
+#define PCIOCWRITE_FREEBSD6 _IOWR('p', 3, struct pci_io_freebsd6)
static int
-pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches,
+pci_conf_match_freebsd6(struct pci_match_conf_freebsd6 *matches, int num_matches,
struct pci_conf *match_buf)
{
int i;
@@ -389,7 +389,7 @@
/*
* I'm not sure why someone would do this...but...
*/
- if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD)
+ if (matches[i].flags == PCI_GETCONF_NO_MATCH_FREEBSD6)
continue;
/*
@@ -397,35 +397,35 @@
* comparison. If the comparison fails, we don't have a
* match, go on to the next item if there is one.
*/
- if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_FREEBSD6) != 0)
&& (match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_FREEBSD6) != 0)
&& (match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_FREEBSD6) != 0)
&& (match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_FREEBSD6) != 0)
&& (match_buf->pc_vendor != matches[i].pc_vendor))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_FREEBSD6) != 0)
&& (match_buf->pc_device != matches[i].pc_device))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_FREEBSD6) != 0)
&& (match_buf->pc_class != matches[i].pc_class))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_FREEBSD6) != 0)
&& (match_buf->pd_unit != matches[i].pd_unit))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_OLD) != 0)
+ if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_FREEBSD6) != 0)
&& (strncmp(matches[i].pd_name, match_buf->pd_name,
sizeof(match_buf->pd_name)) != 0))
continue;
@@ -438,7 +438,7 @@
#ifdef COMPAT_FREEBSD32
static int
-pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches,
+pci_conf_match_freebsd6_32(struct pci_match_conf_freebsd6_32 *matches, int num_matches,
struct pci_conf *match_buf)
{
int i;
@@ -453,7 +453,7 @@
/*
* I'm not sure why someone would do this...but...
*/
- if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD)
+ if (matches[i].flags == PCI_GETCONF_NO_MATCH_FREEBSD6)
continue;
/*
@@ -461,35 +461,35 @@
* comparison. If the comparison fails, we don't have a
* match, go on to the next item if there is one.
*/
- if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_FREEBSD6) != 0) &&
(match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_FREEBSD6) != 0) &&
(match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_FREEBSD6) != 0) &&
(match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_FREEBSD6) != 0) &&
(match_buf->pc_vendor != matches[i].pc_vendor))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_FREEBSD6) != 0) &&
(match_buf->pc_device != matches[i].pc_device))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_FREEBSD6) != 0) &&
(match_buf->pc_class != matches[i].pc_class))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_FREEBSD6) != 0) &&
((u_int32_t)match_buf->pd_unit != matches[i].pd_unit))
continue;
- if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_OLD) != 0) &&
+ if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_FREEBSD6) != 0) &&
(strncmp(matches[i].pd_name, match_buf->pd_name,
sizeof(match_buf->pd_name)) != 0))
continue;
@@ -503,14 +503,14 @@
#endif /* !PRE7_COMPAT */
union pci_conf_union {
- struct pci_conf pc;
+ struct pci_conf pc;
#ifdef COMPAT_FREEBSD32
- struct pci_conf32 pc32;
+ struct pci_conf32 pc32;
#endif
#ifdef PRE7_COMPAT
- struct pci_conf_old pco;
+ struct pci_conf_freebsd6 pco;
#ifdef COMPAT_FREEBSD32
- struct pci_conf_old32 pco32;
+ struct pci_conf_freebsd6_32 pco32;
#endif
#endif
};
@@ -530,14 +530,14 @@
num_matches, match_buf));
#endif
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
- return (pci_conf_match_old(
- (struct pci_match_conf_old *)matches, num_matches,
+ case PCIOCGETCONF_FREEBSD6:
+ return (pci_conf_match_freebsd6(
+ (struct pci_match_conf_freebsd6 *)matches, num_matches,
match_buf));
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
- return (pci_conf_match_old32(
- (struct pci_match_conf_old32 *)matches, num_matches,
+ case PCIOCGETCONF_FREEBSD6_32:
+ return (pci_conf_match_freebsd6_32(
+ (struct pci_match_conf_freebsd6_32 *)matches, num_matches,
match_buf));
#endif
#endif
@@ -651,11 +651,11 @@
return (sizeof(struct pci_match_conf32));
#endif
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
- return (sizeof(struct pci_match_conf_old));
+ case PCIOCGETCONF_FREEBSD6:
+ return (sizeof(struct pci_match_conf_freebsd6));
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
- return (sizeof(struct pci_match_conf_old32));
+ case PCIOCGETCONF_FREEBSD6_32:
+ return (sizeof(struct pci_match_conf_freebsd6_32));
#endif
#endif
default:
@@ -676,11 +676,11 @@
return (sizeof(struct pci_conf32));
#endif
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
- return (sizeof(struct pci_conf_old));
+ case PCIOCGETCONF_FREEBSD6:
+ return (sizeof(struct pci_conf_freebsd6));
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
- return (sizeof(struct pci_conf_old32));
+ case PCIOCGETCONF_FREEBSD6_32:
+ return (sizeof(struct pci_conf_freebsd6_32));
#endif
#endif
default:
@@ -699,7 +699,7 @@
switch (cmd) {
case PCIOCGETCONF:
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
+ case PCIOCGETCONF_FREEBSD6:
#endif
*cio = *(struct pci_conf_io *)data;
return;
@@ -707,7 +707,7 @@
#ifdef COMPAT_FREEBSD32
case PCIOCGETCONF32:
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD32:
+ case PCIOCGETCONF_FREEBSD6_32:
#endif
cio32 = (struct pci_conf_io32 *)data;
cio->pat_buf_len = cio32->pat_buf_len;
@@ -740,7 +740,7 @@
switch (cmd) {
case PCIOCGETCONF:
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
+ case PCIOCGETCONF_FREEBSD6:
#endif
d_cio = (struct pci_conf_io *)data;
d_cio->status = cio->status;
@@ -752,7 +752,7 @@
#ifdef COMPAT_FREEBSD32
case PCIOCGETCONF32:
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD32:
+ case PCIOCGETCONF_FREEBSD6_32:
#endif
cio32 = (struct pci_conf_io32 *)data;
@@ -801,7 +801,7 @@
#ifdef PRE7_COMPAT
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
+ case PCIOCGETCONF_FREEBSD6_32:
pcup->pco32.pc_sel.pc_bus = pcp->pc_sel.pc_bus;
pcup->pco32.pc_sel.pc_dev = pcp->pc_sel.pc_dev;
pcup->pco32.pc_sel.pc_func = pcp->pc_sel.pc_func;
@@ -820,7 +820,7 @@
return;
#endif /* COMPAT_FREEBSD32 */
- case PCIOCGETCONF_OLD:
+ case PCIOCGETCONF_FREEBSD6:
pcup->pco.pc_sel.pc_bus = pcp->pc_sel.pc_bus;
pcup->pco.pc_sel.pc_dev = pcp->pc_sel.pc_dev;
pcup->pco.pc_sel.pc_func = pcp->pc_sel.pc_func;
@@ -1028,9 +1028,9 @@
union pci_conf_union pcu;
#ifdef PRE7_COMPAT
struct pci_io iodata;
- struct pci_io_old *io_old;
+ struct pci_io_freebsd6 *io_freebsd6;
- io_old = NULL;
+ io_freebsd6 = NULL;
#endif
/*
@@ -1045,9 +1045,9 @@
case PCIOCGETCONF32:
#endif
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
+ case PCIOCGETCONF_FREEBSD6:
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
+ case PCIOCGETCONF_FREEBSD6_32:
#endif
#endif
case PCIOCGETBAR:
@@ -1070,9 +1070,9 @@
case PCIOCGETCONF32:
#endif
#ifdef PRE7_COMPAT
- case PCIOCGETCONF_OLD:
+ case PCIOCGETCONF_FREEBSD6:
#ifdef COMPAT_FREEBSD32
- case PCIOCGETCONF_OLD32:
+ case PCIOCGETCONF_FREEBSD6_32:
#endif
#endif
cio = malloc(sizeof(struct pci_conf_io), M_TEMP,
@@ -1258,16 +1258,16 @@
break;
#ifdef PRE7_COMPAT
- case PCIOCREAD_OLD:
- case PCIOCWRITE_OLD:
- io_old = (struct pci_io_old *)data;
+ case PCIOCREAD_FREEBSD6:
+ case PCIOCWRITE_FREEBSD6:
+ io_freebsd6 = (struct pci_io_freebsd6 *)data;
iodata.pi_sel.pc_domain = 0;
- iodata.pi_sel.pc_bus = io_old->pi_sel.pc_bus;
- iodata.pi_sel.pc_dev = io_old->pi_sel.pc_dev;
- iodata.pi_sel.pc_func = io_old->pi_sel.pc_func;
- iodata.pi_reg = io_old->pi_reg;
- iodata.pi_width = io_old->pi_width;
- iodata.pi_data = io_old->pi_data;
+ iodata.pi_sel.pc_bus = io_freebsd6->pi_sel.pc_bus;
+ iodata.pi_sel.pc_dev = io_freebsd6->pi_sel.pc_dev;
+ iodata.pi_sel.pc_func = io_freebsd6->pi_sel.pc_func;
+ iodata.pi_reg = io_freebsd6->pi_reg;
+ iodata.pi_width = io_freebsd6->pi_width;
+ iodata.pi_data = io_freebsd6->pi_data;
data = (caddr_t)&iodata;
/* FALLTHROUGH */
#endif
@@ -1295,7 +1295,7 @@
io->pi_sel.pc_func);
if (pcidev) {
#ifdef PRE7_COMPAT
- if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_OLD)
+ if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_FREEBSD6)
#else
if (cmd == PCIOCWRITE)
#endif
@@ -1304,8 +1304,8 @@
io->pi_data,
io->pi_width);
#ifdef PRE7_COMPAT
- else if (cmd == PCIOCREAD_OLD)
- io_old->pi_data =
+ else if (cmd == PCIOCREAD_FREEBSD6)
+ io_freebsd6->pi_data =
pci_read_config(pcidev,
io->pi_reg,
io->pi_width);
@@ -1318,8 +1318,8 @@
error = 0;
} else {
#ifdef COMPAT_FREEBSD4
- if (cmd == PCIOCREAD_OLD) {
- io_old->pi_data = -1;
+ if (cmd == PCIOCREAD_FREEBSD6) {
+ io_freebsd6->pi_data = -1;
error = 0;
} else
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 2:20 AM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14752283
Default Alt Text
D45867.diff (13 KB)
Attached To
Mode
D45867: pci_user: Rename _old to _freebsd6
Attached
Detach File
Event Timeline
Log In to Comment