diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-05-09 18:54:49 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-05-09 18:54:49 -0400 |
commit | 2c4f365ad2361c93c097e958b2b0a7a112750228 (patch) | |
tree | 83c046142a6e057f005b97b4b7356cd4ff7a9783 | |
parent | 3cb7396b7b26585b1ab7c1a8ca554ec103da5d37 (diff) | |
parent | 47c93d2faf9d7e94393852823480ea61c868caee (diff) |
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_dma.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 81 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 4 | ||||
-rw-r--r-- | include/net/ieee80211.h | 2 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_geo.c | 16 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 8 |
8 files changed, 31 insertions, 121 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index f8483c179e4c..10e07e865426 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -658,12 +658,6 @@ struct bcm43xx_pio { | |||
658 | 658 | ||
659 | #define BCM43xx_MAX_80211_CORES 2 | 659 | #define BCM43xx_MAX_80211_CORES 2 |
660 | 660 | ||
661 | #ifdef CONFIG_BCM947XX | ||
662 | #define core_offset(bcm) (bcm)->current_core_offset | ||
663 | #else | ||
664 | #define core_offset(bcm) 0 | ||
665 | #endif | ||
666 | |||
667 | /* Generic information about a core. */ | 661 | /* Generic information about a core. */ |
668 | struct bcm43xx_coreinfo { | 662 | struct bcm43xx_coreinfo { |
669 | u8 available:1, | 663 | u8 available:1, |
@@ -789,10 +783,6 @@ struct bcm43xx_private { | |||
789 | 783 | ||
790 | /* The currently active core. */ | 784 | /* The currently active core. */ |
791 | struct bcm43xx_coreinfo *current_core; | 785 | struct bcm43xx_coreinfo *current_core; |
792 | #ifdef CONFIG_BCM947XX | ||
793 | /** current core memory offset */ | ||
794 | u32 current_core_offset; | ||
795 | #endif | ||
796 | struct bcm43xx_coreinfo *active_80211_core; | 786 | struct bcm43xx_coreinfo *active_80211_core; |
797 | /* coreinfo structs for all possible cores follow. | 787 | /* coreinfo structs for all possible cores follow. |
798 | * Note that a core might not exist. | 788 | * Note that a core might not exist. |
@@ -943,25 +933,25 @@ struct bcm43xx_lopair * bcm43xx_get_lopair(struct bcm43xx_phyinfo *phy, | |||
943 | static inline | 933 | static inline |
944 | u16 bcm43xx_read16(struct bcm43xx_private *bcm, u16 offset) | 934 | u16 bcm43xx_read16(struct bcm43xx_private *bcm, u16 offset) |
945 | { | 935 | { |
946 | return ioread16(bcm->mmio_addr + core_offset(bcm) + offset); | 936 | return ioread16(bcm->mmio_addr + offset); |
947 | } | 937 | } |
948 | 938 | ||
949 | static inline | 939 | static inline |
950 | void bcm43xx_write16(struct bcm43xx_private *bcm, u16 offset, u16 value) | 940 | void bcm43xx_write16(struct bcm43xx_private *bcm, u16 offset, u16 value) |
951 | { | 941 | { |
952 | iowrite16(value, bcm->mmio_addr + core_offset(bcm) + offset); | 942 | iowrite16(value, bcm->mmio_addr + offset); |
953 | } | 943 | } |
954 | 944 | ||
955 | static inline | 945 | static inline |
956 | u32 bcm43xx_read32(struct bcm43xx_private *bcm, u16 offset) | 946 | u32 bcm43xx_read32(struct bcm43xx_private *bcm, u16 offset) |
957 | { | 947 | { |
958 | return ioread32(bcm->mmio_addr + core_offset(bcm) + offset); | 948 | return ioread32(bcm->mmio_addr + offset); |
959 | } | 949 | } |
960 | 950 | ||
961 | static inline | 951 | static inline |
962 | void bcm43xx_write32(struct bcm43xx_private *bcm, u16 offset, u32 value) | 952 | void bcm43xx_write32(struct bcm43xx_private *bcm, u16 offset, u32 value) |
963 | { | 953 | { |
964 | iowrite32(value, bcm->mmio_addr + core_offset(bcm) + offset); | 954 | iowrite32(value, bcm->mmio_addr + offset); |
965 | } | 955 | } |
966 | 956 | ||
967 | static inline | 957 | static inline |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index e3d2e61a31ee..1f7731fcfbd5 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -660,10 +660,6 @@ struct bcm43xx_dmaring * bcm43xx_setup_dmaring(struct bcm43xx_private *bcm, | |||
660 | ring->routing = BCM43xx_DMA32_CLIENTTRANS; | 660 | ring->routing = BCM43xx_DMA32_CLIENTTRANS; |
661 | if (dma64) | 661 | if (dma64) |
662 | ring->routing = BCM43xx_DMA64_CLIENTTRANS; | 662 | ring->routing = BCM43xx_DMA64_CLIENTTRANS; |
663 | #ifdef CONFIG_BCM947XX | ||
664 | if (bcm->pci_dev->bus->number == 0) | ||
665 | ring->routing = dma64 ? BCM43xx_DMA64_NOTRANS : BCM43xx_DMA32_NOTRANS; | ||
666 | #endif | ||
667 | 663 | ||
668 | ring->bcm = bcm; | 664 | ring->bcm = bcm; |
669 | ring->nr_slots = nr_slots; | 665 | ring->nr_slots = nr_slots; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 5e96bca6730a..ef6b253a92ce 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -61,10 +61,6 @@ MODULE_AUTHOR("Stefano Brivio"); | |||
61 | MODULE_AUTHOR("Michael Buesch"); | 61 | MODULE_AUTHOR("Michael Buesch"); |
62 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
63 | 63 | ||
64 | #ifdef CONFIG_BCM947XX | ||
65 | extern char *nvram_get(char *name); | ||
66 | #endif | ||
67 | |||
68 | #if defined(CONFIG_BCM43XX_DMA) && defined(CONFIG_BCM43XX_PIO) | 64 | #if defined(CONFIG_BCM43XX_DMA) && defined(CONFIG_BCM43XX_PIO) |
69 | static int modparam_pio; | 65 | static int modparam_pio; |
70 | module_param_named(pio, modparam_pio, int, 0444); | 66 | module_param_named(pio, modparam_pio, int, 0444); |
@@ -142,10 +138,6 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for .fw files. Useful for using multiple fi | |||
142 | { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 138 | { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
143 | /* Broadcom 43XG 802.11b/g */ | 139 | /* Broadcom 43XG 802.11b/g */ |
144 | { PCI_VENDOR_ID_BROADCOM, 0x4325, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 140 | { PCI_VENDOR_ID_BROADCOM, 0x4325, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
145 | #ifdef CONFIG_BCM947XX | ||
146 | /* SB bus on BCM947xx */ | ||
147 | { PCI_VENDOR_ID_BROADCOM, 0x0800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | ||
148 | #endif | ||
149 | { 0 }, | 141 | { 0 }, |
150 | }; | 142 | }; |
151 | MODULE_DEVICE_TABLE(pci, bcm43xx_pci_tbl); | 143 | MODULE_DEVICE_TABLE(pci, bcm43xx_pci_tbl); |
@@ -786,9 +778,6 @@ static int bcm43xx_sprom_extract(struct bcm43xx_private *bcm) | |||
786 | { | 778 | { |
787 | u16 value; | 779 | u16 value; |
788 | u16 *sprom; | 780 | u16 *sprom; |
789 | #ifdef CONFIG_BCM947XX | ||
790 | char *c; | ||
791 | #endif | ||
792 | 781 | ||
793 | sprom = kzalloc(BCM43xx_SPROM_SIZE * sizeof(u16), | 782 | sprom = kzalloc(BCM43xx_SPROM_SIZE * sizeof(u16), |
794 | GFP_KERNEL); | 783 | GFP_KERNEL); |
@@ -796,28 +785,7 @@ static int bcm43xx_sprom_extract(struct bcm43xx_private *bcm) | |||
796 | printk(KERN_ERR PFX "sprom_extract OOM\n"); | 785 | printk(KERN_ERR PFX "sprom_extract OOM\n"); |
797 | return -ENOMEM; | 786 | return -ENOMEM; |
798 | } | 787 | } |
799 | #ifdef CONFIG_BCM947XX | ||
800 | sprom[BCM43xx_SPROM_BOARDFLAGS2] = atoi(nvram_get("boardflags2")); | ||
801 | sprom[BCM43xx_SPROM_BOARDFLAGS] = atoi(nvram_get("boardflags")); | ||
802 | |||
803 | if ((c = nvram_get("il0macaddr")) != NULL) | ||
804 | e_aton(c, (char *) &(sprom[BCM43xx_SPROM_IL0MACADDR])); | ||
805 | |||
806 | if ((c = nvram_get("et1macaddr")) != NULL) | ||
807 | e_aton(c, (char *) &(sprom[BCM43xx_SPROM_ET1MACADDR])); | ||
808 | |||
809 | sprom[BCM43xx_SPROM_PA0B0] = atoi(nvram_get("pa0b0")); | ||
810 | sprom[BCM43xx_SPROM_PA0B1] = atoi(nvram_get("pa0b1")); | ||
811 | sprom[BCM43xx_SPROM_PA0B2] = atoi(nvram_get("pa0b2")); | ||
812 | |||
813 | sprom[BCM43xx_SPROM_PA1B0] = atoi(nvram_get("pa1b0")); | ||
814 | sprom[BCM43xx_SPROM_PA1B1] = atoi(nvram_get("pa1b1")); | ||
815 | sprom[BCM43xx_SPROM_PA1B2] = atoi(nvram_get("pa1b2")); | ||
816 | |||
817 | sprom[BCM43xx_SPROM_BOARDREV] = atoi(nvram_get("boardrev")); | ||
818 | #else | ||
819 | bcm43xx_sprom_read(bcm, sprom); | 788 | bcm43xx_sprom_read(bcm, sprom); |
820 | #endif | ||
821 | 789 | ||
822 | /* boardflags2 */ | 790 | /* boardflags2 */ |
823 | value = sprom[BCM43xx_SPROM_BOARDFLAGS2]; | 791 | value = sprom[BCM43xx_SPROM_BOARDFLAGS2]; |
@@ -1225,12 +1193,6 @@ static int _switch_core(struct bcm43xx_private *bcm, int core) | |||
1225 | goto error; | 1193 | goto error; |
1226 | udelay(10); | 1194 | udelay(10); |
1227 | } | 1195 | } |
1228 | #ifdef CONFIG_BCM947XX | ||
1229 | if (bcm->pci_dev->bus->number == 0) | ||
1230 | bcm->current_core_offset = 0x1000 * core; | ||
1231 | else | ||
1232 | bcm->current_core_offset = 0; | ||
1233 | #endif | ||
1234 | 1196 | ||
1235 | return 0; | 1197 | return 0; |
1236 | error: | 1198 | error: |
@@ -1387,19 +1349,6 @@ void bcm43xx_wireless_core_reset(struct bcm43xx_private *bcm, int connect_phy) | |||
1387 | 1349 | ||
1388 | if ((bcm43xx_core_enabled(bcm)) && | 1350 | if ((bcm43xx_core_enabled(bcm)) && |
1389 | !bcm43xx_using_pio(bcm)) { | 1351 | !bcm43xx_using_pio(bcm)) { |
1390 | //FIXME: Do we _really_ want #ifndef CONFIG_BCM947XX here? | ||
1391 | #if 0 | ||
1392 | #ifndef CONFIG_BCM947XX | ||
1393 | /* reset all used DMA controllers. */ | ||
1394 | bcm43xx_dmacontroller_tx_reset(bcm, BCM43xx_MMIO_DMA1_BASE); | ||
1395 | bcm43xx_dmacontroller_tx_reset(bcm, BCM43xx_MMIO_DMA2_BASE); | ||
1396 | bcm43xx_dmacontroller_tx_reset(bcm, BCM43xx_MMIO_DMA3_BASE); | ||
1397 | bcm43xx_dmacontroller_tx_reset(bcm, BCM43xx_MMIO_DMA4_BASE); | ||
1398 | bcm43xx_dmacontroller_rx_reset(bcm, BCM43xx_MMIO_DMA1_BASE); | ||
1399 | if (bcm->current_core->rev < 5) | ||
1400 | bcm43xx_dmacontroller_rx_reset(bcm, BCM43xx_MMIO_DMA4_BASE); | ||
1401 | #endif | ||
1402 | #endif | ||
1403 | } | 1352 | } |
1404 | if (bcm43xx_status(bcm) == BCM43xx_STAT_SHUTTINGDOWN) { | 1353 | if (bcm43xx_status(bcm) == BCM43xx_STAT_SHUTTINGDOWN) { |
1405 | bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, | 1354 | bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, |
@@ -2140,32 +2089,11 @@ out: | |||
2140 | return err; | 2089 | return err; |
2141 | } | 2090 | } |
2142 | 2091 | ||
2143 | #ifdef CONFIG_BCM947XX | ||
2144 | static struct pci_device_id bcm43xx_47xx_ids[] = { | ||
2145 | { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) }, | ||
2146 | { 0 } | ||
2147 | }; | ||
2148 | #endif | ||
2149 | |||
2150 | static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm) | 2092 | static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm) |
2151 | { | 2093 | { |
2152 | int err; | 2094 | int err; |
2153 | 2095 | ||
2154 | bcm->irq = bcm->pci_dev->irq; | 2096 | bcm->irq = bcm->pci_dev->irq; |
2155 | #ifdef CONFIG_BCM947XX | ||
2156 | if (bcm->pci_dev->bus->number == 0) { | ||
2157 | struct pci_dev *d; | ||
2158 | struct pci_device_id *id; | ||
2159 | for (id = bcm43xx_47xx_ids; id->vendor; id++) { | ||
2160 | d = pci_get_device(id->vendor, id->device, NULL); | ||
2161 | if (d != NULL) { | ||
2162 | bcm->irq = d->irq; | ||
2163 | pci_dev_put(d); | ||
2164 | break; | ||
2165 | } | ||
2166 | } | ||
2167 | } | ||
2168 | #endif | ||
2169 | err = request_irq(bcm->irq, bcm43xx_interrupt_handler, | 2097 | err = request_irq(bcm->irq, bcm43xx_interrupt_handler, |
2170 | IRQF_SHARED, KBUILD_MODNAME, bcm); | 2098 | IRQF_SHARED, KBUILD_MODNAME, bcm); |
2171 | if (err) | 2099 | if (err) |
@@ -2645,10 +2573,6 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) | |||
2645 | chip_id_16 = 0x4610; | 2573 | chip_id_16 = 0x4610; |
2646 | else if ((pci_device >= 0x4710) && (pci_device <= 0x4715)) | 2574 | else if ((pci_device >= 0x4710) && (pci_device <= 0x4715)) |
2647 | chip_id_16 = 0x4710; | 2575 | chip_id_16 = 0x4710; |
2648 | #ifdef CONFIG_BCM947XX | ||
2649 | else if ((pci_device >= 0x4320) && (pci_device <= 0x4325)) | ||
2650 | chip_id_16 = 0x4309; | ||
2651 | #endif | ||
2652 | else { | 2576 | else { |
2653 | printk(KERN_ERR PFX "Could not determine Chip ID\n"); | 2577 | printk(KERN_ERR PFX "Could not determine Chip ID\n"); |
2654 | return -ENODEV; | 2578 | return -ENODEV; |
@@ -4144,11 +4068,6 @@ static int __devinit bcm43xx_init_one(struct pci_dev *pdev, | |||
4144 | struct bcm43xx_private *bcm; | 4068 | struct bcm43xx_private *bcm; |
4145 | int err; | 4069 | int err; |
4146 | 4070 | ||
4147 | #ifdef CONFIG_BCM947XX | ||
4148 | if ((pdev->bus->number == 0) && (pdev->device != 0x0800)) | ||
4149 | return -ENODEV; | ||
4150 | #endif | ||
4151 | |||
4152 | #ifdef DEBUG_SINGLE_DEVICE_ONLY | 4071 | #ifdef DEBUG_SINGLE_DEVICE_ONLY |
4153 | if (strcmp(pci_name(pdev), DEBUG_SINGLE_DEVICE_ONLY)) | 4072 | if (strcmp(pci_name(pdev), DEBUG_SINGLE_DEVICE_ONLY)) |
4154 | return -ENODEV; | 4073 | return -ENODEV; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h index f76357178e4d..c8f3c532bab5 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h | |||
@@ -33,25 +33,6 @@ | |||
33 | 33 | ||
34 | #include "bcm43xx.h" | 34 | #include "bcm43xx.h" |
35 | 35 | ||
36 | #ifdef CONFIG_BCM947XX | ||
37 | #define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0) | ||
38 | |||
39 | static inline void e_aton(char *str, char *dest) | ||
40 | { | ||
41 | int i = 0; | ||
42 | u16 *d = (u16 *) dest; | ||
43 | |||
44 | for (;;) { | ||
45 | dest[i++] = (char) simple_strtoul(str, NULL, 16); | ||
46 | str += 2; | ||
47 | if (!*str++ || i == 6) | ||
48 | break; | ||
49 | } | ||
50 | for (i = 0; i < 3; i++) | ||
51 | d[i] = cpu_to_be16(d[i]); | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | #define P4D_BYT3S(magic, nr_bytes) u8 __p4dding##magic[nr_bytes] | 36 | #define P4D_BYT3S(magic, nr_bytes) u8 __p4dding##magic[nr_bytes] |
56 | #define P4D_BYTES(line, nr_bytes) P4D_BYT3S(line, nr_bytes) | 37 | #define P4D_BYTES(line, nr_bytes) P4D_BYT3S(line, nr_bytes) |
57 | /* Magic helper macro to pad structures. Ignore those above. It's magic. */ | 38 | /* Magic helper macro to pad structures. Ignore those above. It's magic. */ |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index e04cffc8adf3..8459549d0cee 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -40,6 +40,7 @@ static struct usb_device_id usb_ids[] = { | |||
40 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, | 40 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, |
41 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, | 41 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, |
42 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, | 42 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, |
43 | { USB_DEVICE(0x0df6, 0x9075), .driver_info = DEVICE_ZD1211 }, | ||
43 | { USB_DEVICE(0x157e, 0x300b), .driver_info = DEVICE_ZD1211 }, | 44 | { USB_DEVICE(0x157e, 0x300b), .driver_info = DEVICE_ZD1211 }, |
44 | { USB_DEVICE(0x079b, 0x004a), .driver_info = DEVICE_ZD1211 }, | 45 | { USB_DEVICE(0x079b, 0x004a), .driver_info = DEVICE_ZD1211 }, |
45 | { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 }, | 46 | { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 }, |
@@ -67,8 +68,11 @@ static struct usb_device_id usb_ids[] = { | |||
67 | { USB_DEVICE(0x0586, 0x3410), .driver_info = DEVICE_ZD1211B }, | 68 | { USB_DEVICE(0x0586, 0x3410), .driver_info = DEVICE_ZD1211B }, |
68 | { USB_DEVICE(0x0baf, 0x0121), .driver_info = DEVICE_ZD1211B }, | 69 | { USB_DEVICE(0x0baf, 0x0121), .driver_info = DEVICE_ZD1211B }, |
69 | { USB_DEVICE(0x0586, 0x3412), .driver_info = DEVICE_ZD1211B }, | 70 | { USB_DEVICE(0x0586, 0x3412), .driver_info = DEVICE_ZD1211B }, |
71 | { USB_DEVICE(0x0586, 0x3413), .driver_info = DEVICE_ZD1211B }, | ||
72 | { USB_DEVICE(0x0053, 0x5301), .driver_info = DEVICE_ZD1211B }, | ||
70 | /* "Driverless" devices that need ejecting */ | 73 | /* "Driverless" devices that need ejecting */ |
71 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 74 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
75 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | ||
72 | {} | 76 | {} |
73 | }; | 77 | }; |
74 | 78 | ||
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index d56b2923d61a..bbd85cd61ed5 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -1291,6 +1291,8 @@ extern u8 ieee80211_get_channel_flags(struct ieee80211_device *ieee, | |||
1291 | extern const struct ieee80211_channel *ieee80211_get_channel(struct | 1291 | extern const struct ieee80211_channel *ieee80211_get_channel(struct |
1292 | ieee80211_device | 1292 | ieee80211_device |
1293 | *ieee, u8 channel); | 1293 | *ieee, u8 channel); |
1294 | extern u32 ieee80211_channel_to_freq(struct ieee80211_device * ieee, | ||
1295 | u8 channel); | ||
1294 | 1296 | ||
1295 | /* ieee80211_wx.c */ | 1297 | /* ieee80211_wx.c */ |
1296 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, | 1298 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, |
diff --git a/net/ieee80211/ieee80211_geo.c b/net/ieee80211/ieee80211_geo.c index 305a09de85a5..960ad13f5e9f 100644 --- a/net/ieee80211/ieee80211_geo.c +++ b/net/ieee80211/ieee80211_geo.c | |||
@@ -94,6 +94,21 @@ int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel) | |||
94 | return -1; | 94 | return -1; |
95 | } | 95 | } |
96 | 96 | ||
97 | u32 ieee80211_channel_to_freq(struct ieee80211_device * ieee, u8 channel) | ||
98 | { | ||
99 | const struct ieee80211_channel * ch; | ||
100 | |||
101 | /* Driver needs to initialize the geography map before using | ||
102 | * these helper functions */ | ||
103 | if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) | ||
104 | return 0; | ||
105 | |||
106 | ch = ieee80211_get_channel(ieee, channel); | ||
107 | if (!ch->channel) | ||
108 | return 0; | ||
109 | return ch->freq; | ||
110 | } | ||
111 | |||
97 | u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq) | 112 | u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq) |
98 | { | 113 | { |
99 | int i; | 114 | int i; |
@@ -174,6 +189,7 @@ EXPORT_SYMBOL(ieee80211_get_channel); | |||
174 | EXPORT_SYMBOL(ieee80211_get_channel_flags); | 189 | EXPORT_SYMBOL(ieee80211_get_channel_flags); |
175 | EXPORT_SYMBOL(ieee80211_is_valid_channel); | 190 | EXPORT_SYMBOL(ieee80211_is_valid_channel); |
176 | EXPORT_SYMBOL(ieee80211_freq_to_channel); | 191 | EXPORT_SYMBOL(ieee80211_freq_to_channel); |
192 | EXPORT_SYMBOL(ieee80211_channel_to_freq); | ||
177 | EXPORT_SYMBOL(ieee80211_channel_to_index); | 193 | EXPORT_SYMBOL(ieee80211_channel_to_index); |
178 | EXPORT_SYMBOL(ieee80211_set_geo); | 194 | EXPORT_SYMBOL(ieee80211_set_geo); |
179 | EXPORT_SYMBOL(ieee80211_get_geo); | 195 | EXPORT_SYMBOL(ieee80211_get_geo); |
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index cee5e13bc427..523a137d49dd 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c | |||
@@ -89,15 +89,17 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee, | |||
89 | start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN); | 89 | start = iwe_stream_add_event(start, stop, &iwe, IW_EV_UINT_LEN); |
90 | } | 90 | } |
91 | 91 | ||
92 | /* Add frequency/channel */ | 92 | /* Add channel and frequency */ |
93 | iwe.cmd = SIOCGIWFREQ; | 93 | iwe.cmd = SIOCGIWFREQ; |
94 | /* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode); | ||
95 | iwe.u.freq.e = 3; */ | ||
96 | iwe.u.freq.m = network->channel; | 94 | iwe.u.freq.m = network->channel; |
97 | iwe.u.freq.e = 0; | 95 | iwe.u.freq.e = 0; |
98 | iwe.u.freq.i = 0; | 96 | iwe.u.freq.i = 0; |
99 | start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN); | 97 | start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN); |
100 | 98 | ||
99 | iwe.u.freq.m = ieee80211_channel_to_freq(ieee, network->channel); | ||
100 | iwe.u.freq.e = 6; | ||
101 | start = iwe_stream_add_event(start, stop, &iwe, IW_EV_FREQ_LEN); | ||
102 | |||
101 | /* Add encryption capability */ | 103 | /* Add encryption capability */ |
102 | iwe.cmd = SIOCGIWENCODE; | 104 | iwe.cmd = SIOCGIWENCODE; |
103 | if (network->capability & WLAN_CAPABILITY_PRIVACY) | 105 | if (network->capability & WLAN_CAPABILITY_PRIVACY) |