diff -Naurp linux-2.6.8.1/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.8.1-prism54/drivers/net/wireless/prism54/isl_ioctl.c --- linux-2.6.8.1/drivers/net/wireless/prism54/isl_ioctl.c 2004-08-16 18:05:53.000000000 +0000 +++ linux-2.6.8.1-prism54/drivers/net/wireless/prism54/isl_ioctl.c 2004-08-16 18:02:34.000000000 +0000 @@ -451,6 +451,15 @@ prism54_get_range(struct net_device *nde /* txpower is supported in dBm's */ range->txpower_capa = IW_TXPOW_DBM; +#if WIRELESS_EXT > 16 + /* Event capability (kernel + driver) */ + range->event_capa[0] = (IW_EVENT_CAPA_K_0 | + IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) | + IW_EVENT_CAPA_MASK(SIOCGIWAP)); + range->event_capa[1] = IW_EVENT_CAPA_K_1; + range->event_capa[4] = IW_EVENT_CAPA_MASK(IWEVCUSTOM); +#endif /* WIRELESS_EXT > 16 */ + if (islpci_get_state(priv) < PRV_STATE_INIT) return 0; @@ -656,19 +665,33 @@ prism54_get_scan(struct net_device *ndev rvalue = mgt_get_request(priv, DOT11_OID_NOISEFLOOR, 0, NULL, &r); noise = r.u; - /* Ask the device for a list of known bss. We can report at most - * IW_MAX_AP=64 to the range struct. But the device won't repport anything - * if you change the value of IWMAX_BSS=24. - */ + /* Ask the device for a list of known bss. + * The old API, using SIOCGIWAPLIST, had a hard limit of IW_MAX_AP=64. + * The new API, using SIOCGIWSCAN, is only limited by the buffer size. + * WE-14->WE-16, the buffer is limited to IW_SCAN_MAX_DATA bytes. + * Starting with WE-17, the buffer can be as big as needed. + * But the device won't repport anything if you change the value + * of IWMAX_BSS=24. */ + rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r); bsslist = r.ptr; /* ok now, scan the list and translate its info */ - for (i = 0; i < min(IW_MAX_AP, (int) bsslist->nr); i++) + for (i = 0; i < (int) bsslist->nr; i++) { current_ev = prism54_translate_bss(ndev, current_ev, - extra + IW_SCAN_MAX_DATA, + extra + dwrq->length, &(bsslist->bsslist[i]), noise); +#if WIRELESS_EXT > 16 + /* Check if there is space for one more entry */ + if((extra + dwrq->length - current_ev) <= IW_EV_ADDR_LEN) { + /* Ask user space to try again with a bigger buffer */ + rvalue = -E2BIG; + break; + } +#endif /* WIRELESS_EXT > 16 */ + } + kfree(bsslist); dwrq->length = (current_ev - extra); dwrq->flags = 0; /* todo */ @@ -2222,7 +2245,9 @@ const struct iw_handler_def prism54_hand .standard = (iw_handler *) prism54_handler, .private = (iw_handler *) prism54_private_handler, .private_args = (struct iw_priv_args *) prism54_private_args, +#if WIRELESS_EXT == 16 .spy_offset = offsetof(islpci_private, spy_data), +#endif /* WIRELESS_EXT == 16 */ }; /* For ioctls that don't work with the new API */ diff -Naurp linux-2.6.8.1/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.8.1-prism54/drivers/net/wireless/prism54/islpci_dev.c --- linux-2.6.8.1/drivers/net/wireless/prism54/islpci_dev.c 2004-08-16 14:47:48.000000000 +0000 +++ linux-2.6.8.1-prism54/drivers/net/wireless/prism54/islpci_dev.c 2004-08-16 18:10:30.000000000 +0000 @@ -829,6 +829,12 @@ islpci_setup(struct pci_dev *pdev) priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR) ? priv->monitor_type : ARPHRD_ETHER; +#if WIRELESS_EXT > 16 + /* Add pointers to enable iwspy support. */ + priv->wireless_data.spy_data = &priv->spy_data; + ndev->wireless_data = &priv->wireless_data; +#endif /* WIRELESS_EXT > 16 */ + /* save the start and end address of the PCI memory area */ ndev->mem_start = (unsigned long) priv->device_base; ndev->mem_end = ndev->mem_start + ISL38XX_PCI_MEM_SIZE; diff -Naurp linux-2.6.8.1/drivers/net/wireless/prism54/islpci_dev.h linux-2.6.8.1-prism54/drivers/net/wireless/prism54/islpci_dev.h --- linux-2.6.8.1/drivers/net/wireless/prism54/islpci_dev.h 2004-07-01 05:54:35.000000000 +0000 +++ linux-2.6.8.1-prism54/drivers/net/wireless/prism54/islpci_dev.h 2004-08-16 18:19:50.000000000 +0000 @@ -100,6 +100,10 @@ typedef struct { struct iw_spy_data spy_data; /* iwspy support */ +#if WIRELESS_EXT > 16 + struct iw_public_data wireless_data; +#endif /* WIRELESS_EXT > 16 */ + int monitor_type; /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_PRISM */ struct islpci_acl acl;