summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-05-20 17:29:21 +0000
committerimp <imp@FreeBSD.org>2009-05-20 17:29:21 +0000
commit3ca3ea71908ddf43687ac7777906573c31fea480 (patch)
tree57c7e52b00a944272cad04dc847cef00b88197de /sys
parent033485e00c6bc9bfdac65bf91b70df092b730e27 (diff)
downloadFreeBSD-src-3ca3ea71908ddf43687ac7777906573c31fea480.zip
FreeBSD-src-3ca3ea71908ddf43687ac7777906573c31fea480.tar.gz
We no longer need to use d_thread_t, migrate to struct thread *.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/aac/aac.c8
-rw-r--r--sys/dev/acpica/acpi.c6
-rw-r--r--sys/dev/amr/amr.c10
-rw-r--r--sys/dev/amr/amr_linux.c2
-rw-r--r--sys/dev/arcmsr/arcmsr.c6
-rw-r--r--sys/dev/ata/ata-all.c2
-rw-r--r--sys/dev/ciss/ciss.c6
-rw-r--r--sys/dev/cxgb/cxgb_main.c4
-rw-r--r--sys/dev/iir/iir_ctrl.c6
-rw-r--r--sys/dev/mfi/mfi.c10
-rw-r--r--sys/dev/mfi/mfi_linux.c2
-rw-r--r--sys/dev/mpt/mpt_user.c6
-rw-r--r--sys/dev/pci/pci.c87
-rw-r--r--sys/dev/pci/pci_pci.c15
-rw-r--r--sys/dev/pci/pcib_if.m14
-rw-r--r--sys/dev/twa/tw_osl_freebsd.c6
-rw-r--r--sys/dev/twe/twe_freebsd.c6
-rw-r--r--sys/dev/wi/if_wavelan_ieee.h3
-rw-r--r--sys/dev/wi/if_wi.c5
-rw-r--r--sys/dev/wi/if_wivar.h3
20 files changed, 162 insertions, 45 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 1cee9f4..f3d931a 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -2905,7 +2905,7 @@ aac_describe_code(struct aac_code_lookup *table, u_int32_t code)
*/
static int
-aac_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+aac_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct aac_softc *sc;
@@ -2918,7 +2918,7 @@ aac_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
}
static int
-aac_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+aac_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct aac_softc *sc;
@@ -2933,7 +2933,7 @@ aac_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
}
static int
-aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
union aac_statrequest *as;
struct aac_softc *sc;
@@ -3038,7 +3038,7 @@ aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
}
static int
-aac_poll(struct cdev *dev, int poll_events, d_thread_t *td)
+aac_poll(struct cdev *dev, int poll_events, struct thread *td)
{
struct aac_softc *sc;
struct aac_fib_context *ctx;
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index d79b413..4bc059b 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -3186,19 +3186,19 @@ acpi_deregister_ioctl(u_long cmd, acpi_ioctl_fn fn)
}
static int
-acpiopen(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+acpiopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
return (0);
}
static int
-acpiclose(struct cdev *dev, int flag, int fmt, d_thread_t *td)
+acpiclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
return (0);
}
static int
-acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
+acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct acpi_softc *sc;
struct acpi_ioctl_hook *hp;
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 6b75ebb..2061fcc 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -173,7 +173,7 @@ static void amr_printcommand(struct amr_command *ac);
static void amr_init_sysctl(struct amr_softc *sc);
static int amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr,
- int32_t flag, d_thread_t *td);
+ int32_t flag, struct thread *td);
MALLOC_DEFINE(M_AMR, "amr", "AMR memory");
@@ -431,7 +431,7 @@ amr_submit_bio(struct amr_softc *sc, struct bio *bio)
* Accept an open operation on the control device.
*/
static int
-amr_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+amr_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = dev2unit(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -487,7 +487,7 @@ amr_prepare_ld_delete(struct amr_softc *sc)
* Accept the last close on the control device.
*/
static int
-amr_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+amr_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = dev2unit(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -537,7 +537,7 @@ shutdown_out:
int
amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag,
- d_thread_t *td)
+ struct thread *td)
{
struct amr_softc *sc = (struct amr_softc *)dev->si_drv1;
struct amr_command *ac;
@@ -736,7 +736,7 @@ amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag,
}
static int
-amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
+amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
{
struct amr_softc *sc = (struct amr_softc *)dev->si_drv1;
union {
diff --git a/sys/dev/amr/amr_linux.c b/sys/dev/amr/amr_linux.c
index 0fe89d7..cb8c457 100644
--- a/sys/dev/amr/amr_linux.c
+++ b/sys/dev/amr/amr_linux.c
@@ -69,7 +69,7 @@ DEV_MODULE(amr_linux, amr_linux_modevent, NULL);
MODULE_DEPEND(amr, linux, 1, 1, 1);
static int
-amr_linux_ioctl(d_thread_t *p, struct linux_ioctl_args *args)
+amr_linux_ioctl(struct thread *p, struct linux_ioctl_args *args)
{
struct file *fp;
int error;
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c
index 3d19a53..09bce1b 100644
--- a/sys/dev/arcmsr/arcmsr.c
+++ b/sys/dev/arcmsr/arcmsr.c
@@ -249,7 +249,7 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1);
#if __FreeBSD_version < 503000
static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc)
#else
- static int arcmsr_open(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
+ static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc)
#endif
#endif
{
@@ -274,7 +274,7 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1);
#if __FreeBSD_version < 503000
static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc)
#else
- static int arcmsr_close(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
+ static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc)
#endif
#endif
{
@@ -299,7 +299,7 @@ MODULE_DEPEND(arcmsr, cam, 1, 1, 1);
#if __FreeBSD_version < 503000
static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
#else
- static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, d_thread_t *proc)
+ static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
#endif
#endif
{
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 4530767..1131ee1 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -663,7 +663,7 @@ ata_getparam(struct ata_device *atadev, int init)
btrim(atacap->serial, sizeof(atacap->serial));
bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
- if (bootverbose)
+ if (bootverbose || 1)
printf("ata%d-%s: pio=%s wdma=%s udma=%s cable=%s wire\n",
device_get_unit(ch->dev),
ata_unit2str(atadev),
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index f2b89f8..93aea72 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -4442,7 +4442,7 @@ ciss_name_command_status(int status)
* Handle an open on the control device.
*/
static int
-ciss_open(struct cdev *dev, int flags, int fmt, d_thread_t *p)
+ciss_open(struct cdev *dev, int flags, int fmt, struct thread *p)
{
struct ciss_softc *sc;
@@ -4462,7 +4462,7 @@ ciss_open(struct cdev *dev, int flags, int fmt, d_thread_t *p)
* Handle the last close on the control device.
*/
static int
-ciss_close(struct cdev *dev, int flags, int fmt, d_thread_t *p)
+ciss_close(struct cdev *dev, int flags, int fmt, struct thread *p)
{
struct ciss_softc *sc;
@@ -4483,7 +4483,7 @@ ciss_close(struct cdev *dev, int flags, int fmt, d_thread_t *p)
* simplify the porting of Compaq's userland tools.
*/
static int
-ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *p)
+ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *p)
{
struct ciss_softc *sc;
IOCTL_Command_struct *ioc = (IOCTL_Command_struct *)addr;
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index cc09aa0..3108688 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -2528,13 +2528,13 @@ in_range(int val, int lo, int hi)
}
static int
-cxgb_extension_open(struct cdev *dev, int flags, int fmp, d_thread_t *td)
+cxgb_extension_open(struct cdev *dev, int flags, int fmp, struct thread *td)
{
return (0);
}
static int
-cxgb_extension_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+cxgb_extension_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
return (0);
}
diff --git a/sys/dev/iir/iir_ctrl.c b/sys/dev/iir/iir_ctrl.c
index e5fbac94..6546f07 100644
--- a/sys/dev/iir/iir_ctrl.c
+++ b/sys/dev/iir/iir_ctrl.c
@@ -144,7 +144,7 @@ gdt_minor2softc(int minor_no)
}
static int
-iir_open(struct cdev *dev, int flags, int fmt, d_thread_t * p)
+iir_open(struct cdev *dev, int flags, int fmt, struct thread * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_open()\n"));
@@ -162,7 +162,7 @@ iir_open(struct cdev *dev, int flags, int fmt, d_thread_t * p)
}
static int
-iir_close(struct cdev *dev, int flags, int fmt, d_thread_t * p)
+iir_close(struct cdev *dev, int flags, int fmt, struct thread * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_close()\n"));
@@ -222,7 +222,7 @@ iir_read(struct cdev *dev, struct uio * uio, int ioflag)
*/
static int
-iir_ioctl(struct cdev *dev, u_long cmd, caddr_t cmdarg, int flags, d_thread_t * p)
+iir_ioctl(struct cdev *dev, u_long cmd, caddr_t cmdarg, int flags, struct thread * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_ioctl() cmd 0x%lx\n",cmd));
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 7cdb304..cfd8f1d 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -104,7 +104,7 @@ static int mfi_mapcmd(struct mfi_softc *, struct mfi_command *);
static int mfi_send_frame(struct mfi_softc *, struct mfi_command *);
static void mfi_complete(struct mfi_softc *, struct mfi_command *);
static int mfi_abort(struct mfi_softc *, struct mfi_command *);
-static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, d_thread_t *);
+static int mfi_linux_ioctl_int(struct cdev *, u_long, caddr_t, int, struct thread *);
static void mfi_timeout(void *);
static int mfi_user_command(struct mfi_softc *,
struct mfi_ioc_passthru *);
@@ -1686,7 +1686,7 @@ mfi_dump_blocks(struct mfi_softc *sc, int id, uint64_t lba, void *virt, int len)
}
static int
-mfi_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+mfi_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct mfi_softc *sc;
int error;
@@ -1706,7 +1706,7 @@ mfi_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
}
static int
-mfi_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+mfi_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct mfi_softc *sc;
struct mfi_aen *mfi_aen_entry, *tmp;
@@ -1910,7 +1910,7 @@ out:
#endif
static int
-mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
struct mfi_softc *sc;
union mfi_statrequest *ms;
@@ -2234,7 +2234,7 @@ out:
}
static int
-mfi_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+mfi_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
struct mfi_softc *sc;
struct mfi_linux_ioc_packet l_ioc;
diff --git a/sys/dev/mfi/mfi_linux.c b/sys/dev/mfi/mfi_linux.c
index 911c02c..44edf49 100644
--- a/sys/dev/mfi/mfi_linux.c
+++ b/sys/dev/mfi/mfi_linux.c
@@ -80,7 +80,7 @@ DEV_MODULE(mfi_linux, mfi_linux_modevent, NULL);
MODULE_DEPEND(mfi, linux, 1, 1, 1);
static int
-mfi_linux_ioctl(d_thread_t *p, struct linux_ioctl_args *args)
+mfi_linux_ioctl(struct thread *p, struct linux_ioctl_args *args)
{
struct file *fp;
int error;
diff --git a/sys/dev/mpt/mpt_user.c b/sys/dev/mpt/mpt_user.c
index 971c262..6e3b32f 100644
--- a/sys/dev/mpt/mpt_user.c
+++ b/sys/dev/mpt/mpt_user.c
@@ -173,14 +173,14 @@ mpt_user_detach(struct mpt_softc *mpt)
}
static int
-mpt_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+mpt_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
return (0);
}
static int
-mpt_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+mpt_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
return (0);
@@ -585,7 +585,7 @@ mpt_user_raid_action(struct mpt_softc *mpt, struct mpt_raid_action *raid_act,
#endif
static int
-mpt_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+mpt_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
struct mpt_softc *mpt;
struct mpt_cfg_page_req *page_req;
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 3b330c7..af1691b 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -418,6 +418,38 @@ pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg)
#undef REG
}
+/*
+ * This is a lame example: we should have some way of managing this table
+ * from userland. The user should be able to tell us from the boot loader
+ * or at runtime what mapping to do.
+ */
+static struct pci_remap_entry
+{
+ uint16_t vendor;
+ uint16_t device;
+ uint16_t mapped_vendor;
+ uint16_t mapped_device;
+} pci_remap[] =
+{
+ { 0x1039, 0x0901, 0x1039, 0x0900 } /* Map sis 901 to sis 900 */
+};
+static int pci_remap_entries = 1;
+
+static void
+pci_apply_remap_table(pcicfgregs *cfg)
+{
+ int i;
+
+ for (i = 0; i < pci_remap_entries; i++) {
+ if (cfg->vendor == pci_remap[i].vendor &&
+ cfg->device == pci_remap[i].device) {
+ cfg->vendor = pci_remap[i].mapped_vendor;
+ cfg->device = pci_remap[i].mapped_device;
+ return;
+ }
+ }
+}
+
/* read configuration header into pcicfgregs structure */
struct pci_devinfo *
pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size)
@@ -464,6 +496,7 @@ pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size)
pci_fixancient(cfg);
pci_hdrtypedata(pcib, b, s, f, cfg);
+ pci_apply_remap_table(cfg);
if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT)
pci_read_extcap(pcib, cfg);
@@ -2619,6 +2652,59 @@ pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask)
}
}
+/*
+ * After we've added the children to the pci bus device, we need to fixup
+ * the children in various ways. This function fixes things that require
+ * multiple passes to get right, such as bus number and some resource
+ * things (although the latter hasn't been implemented yet). This must be
+ * done before the children are probe/attached, sicne by that point these
+ * things must be fixed.
+ */
+static void
+pci_fix_bridges(device_t dev)
+{
+ int i, numdevs, error, secbus, subbus;
+ device_t child, *devlist;
+
+ if ((error = device_get_children(dev, &devlist, &numdevs)))
+ return;
+ /*
+ * First pass, get the bus numbers that are in use
+ */
+ for (i = 0; i < numdevs; i++) {
+ child = devlist[i];
+ switch (pci_read_config(child, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) {
+ default:
+ continue;
+ case 1: /* PCI-PCI bridge */
+ case 2: /* CardBus bridge -- offsets are the same */
+ secbus = pci_read_config(child, PCIR_SECBUS_1, 1);
+ subbus = pci_read_config(child, PCIR_SUBBUS_1, 1);
+ break;
+ }
+ printf("%d:%d:%d:%d sec %d sub %d\n", pcib_get_domain(dev),
+ pci_get_bus(child), pci_get_slot(child),
+ pci_get_function(child), secbus, subbus);
+ }
+#if 0
+ /*
+ * Second pass, Fix the bus numbers, as needed
+ */
+ for (i = 0; i < numdevs; i++) {
+ child = devlist[i];
+ switch (pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) {
+ case 1: /* PCI-PCI bridge */
+ break;
+ case 2: /* CardBus bridge */
+ break;
+ default:
+ continue;
+ }
+ }
+#endif
+ free(devlist, M_TEMP);
+}
+
void
pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size)
{
@@ -2650,6 +2736,7 @@ pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size)
}
}
#undef REG
+ pci_fix_bridges(dev);
}
void
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index 15cad92..8bb2eff 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -52,6 +52,13 @@ __FBSDID("$FreeBSD$");
#include "pcib_if.h"
+// #define KLUDGE_O_MATIC
+#ifdef KLUDGE_O_MATIC
+int hack_unit = 1;
+u_long mem_base = 0xc0400000ul;
+u_long mem_limit = 0x00100000ul;
+#endif
+
static int pcib_probe(device_t dev);
static device_method_t pcib_methods[] = {
@@ -324,6 +331,14 @@ pcib_attach(device_t dev)
struct pcib_softc *sc;
device_t child;
+#ifdef KLUDGE_O_MATIC
+ if (device_get_unit(dev) == hack_unit) {
+ pci_write_config(dev, PCIR_COMMAND,
+ PCIM_CMD_MEMEN | pci_read_config(dev, PCIR_COMMAND, 1), 1);
+ pci_write_config(dev, PCIR_MEMBASE_1, mem_base >> 16, 2);
+ pci_write_config(dev, PCIR_MEMLIMIT_1, mem_limit >> 16, 2);
+ }
+#endif
pcib_attach_common(dev);
sc = device_get_softc(dev);
if (sc->secbus != 0) {
diff --git a/sys/dev/pci/pcib_if.m b/sys/dev/pci/pcib_if.m
index 0b7e8bc..765e644 100644
--- a/sys/dev/pci/pcib_if.m
+++ b/sys/dev/pci/pcib_if.m
@@ -144,3 +144,17 @@ METHOD int map_msi {
uint64_t *addr;
uint32_t *data;
};
+
+#
+# Return the range of busses passed through this bridge. For normal
+# pci-pci bridges (and compatible things like pci-x and pcie), this will
+# just be the secbus and subbus configuration registers. For non-standard
+# bridges, or for host bridges which have no standard, this will be the
+# same data read from either device specific registers of from "perfect
+# knowledge" of what they must be.
+#
+METHOD int bus_range {
+ device_t pcib;
+ u_int *secbus;
+ u_int *subbus;
+};
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c
index f435c2c..d3f82f3 100644
--- a/sys/dev/twa/tw_osl_freebsd.c
+++ b/sys/dev/twa/tw_osl_freebsd.c
@@ -86,7 +86,7 @@ static devclass_t twa_devclass;
* non-zero-- failure
*/
static TW_INT32
-twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
+twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, struct thread *proc)
{
struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1);
@@ -111,7 +111,7 @@ twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
* non-zero-- failure
*/
static TW_INT32
-twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
+twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, struct thread *proc)
{
struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1);
@@ -140,7 +140,7 @@ twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
* non-zero-- failure
*/
static TW_INT32
-twa_ioctl(struct cdev *dev, u_long cmd, caddr_t buf, TW_INT32 flags, d_thread_t *proc)
+twa_ioctl(struct cdev *dev, u_long cmd, caddr_t buf, TW_INT32 flags, struct thread *proc)
{
struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1);
TW_INT32 error;
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 6a99864..9ad65c9 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -79,7 +79,7 @@ static struct cdevsw twe_cdevsw = {
* Accept an open operation on the control device.
*/
static int
-twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+twe_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct twe_softc *sc = (struct twe_softc *)dev->si_drv1;
@@ -91,7 +91,7 @@ twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
* Accept the last close on the control device.
*/
static int
-twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
+twe_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct twe_softc *sc = (struct twe_softc *)dev->si_drv1;
@@ -103,7 +103,7 @@ twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
* Handle controller-specific control operations.
*/
static int
-twe_ioctl_wrapper(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
+twe_ioctl_wrapper(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
{
struct twe_softc *sc = (struct twe_softc *)dev->si_drv1;
diff --git a/sys/dev/wi/if_wavelan_ieee.h b/sys/dev/wi/if_wavelan_ieee.h
index 0061e63..82bc9e5 100644
--- a/sys/dev/wi/if_wavelan_ieee.h
+++ b/sys/dev/wi/if_wavelan_ieee.h
@@ -58,14 +58,11 @@
* value.
*/
#define WI_MAX_DATALEN 512
-
-#if 0
struct wi_req {
u_int16_t wi_len;
u_int16_t wi_type;
u_int16_t wi_val[WI_MAX_DATALEN];
};
-#endif
/*
* Private LTV records (interpreted only by the driver). This is
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 3dce847..3dc329b 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -143,7 +143,6 @@ static int wi_alloc_fid(struct wi_softc *, int, int *);
static void wi_read_nicid(struct wi_softc *);
static int wi_write_ssid(struct wi_softc *, int, u_int8_t *, int);
-static int wi_cmd(struct wi_softc *, int, int, int, int);
static int wi_seek_bap(struct wi_softc *, int, int);
static int wi_read_bap(struct wi_softc *, int, int, void *, int);
static int wi_write_bap(struct wi_softc *, int, int, void *, int);
@@ -1801,7 +1800,7 @@ wi_write_wep(struct wi_softc *sc, struct ieee80211vap *vap)
return error;
}
-static int
+int
wi_cmd(struct wi_softc *sc, int cmd, int val0, int val1, int val2)
{
int i, s = 0;
@@ -2120,3 +2119,5 @@ wi_free(device_t dev)
sc->mem = NULL;
}
}
+
+MODULE_VERSION(wi, 1);
diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h
index fdcedd8..3739a8e 100644
--- a/sys/dev/wi/if_wivar.h
+++ b/sys/dev/wi/if_wivar.h
@@ -186,3 +186,6 @@ void wi_init(void *);
void wi_intr(void *);
int wi_mgmt_xmit(struct wi_softc *, caddr_t, int);
void wi_stop(struct wi_softc *, int);
+
+/* KLUDGE */
+int wi_cmd(struct wi_softc *, int, int, int, int);
OpenPOWER on IntegriCloud