Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

orinoco: initiate cfg80211 conversion

Initialise and register a wiphy.

Store the orinoco_private structure in the new wiphy, and use the
net_device private area to store the wireless_dev. This results in a
change to the way we navigate from a net_device to the driver private
orinoco_private, which we encapsulate in the inline function ndev_priv.
Most of the remaining calls to netdev_priv are thus replaced by
ndev_priv.

We can immediately rely on cfg80211 to handle SIOCGIWNAME, so
orinoco_ioctl_getname is removed.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

David Kilroy and committed by
John W. Linville
ea60a6aa 98e5f404

+256 -89
+1
drivers/net/wireless/orinoco/Kconfig
··· 1 1 config HERMES 2 2 tristate "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)" 3 3 depends on (PPC_PMAC || PCI || PCMCIA) && WLAN_80211 4 + depends on CFG80211 4 5 select WIRELESS_EXT 5 6 select FW_LOADER 6 7 select CRYPTO
+1 -1
drivers/net/wireless/orinoco/Makefile
··· 1 1 # 2 2 # Makefile for the orinoco wireless device drivers. 3 3 # 4 - orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o hermes.o 4 + orinoco-objs := main.o fw.o hw.o mic.o scan.o wext.o hermes_dld.o hermes.o cfg.o 5 5 6 6 obj-$(CONFIG_HERMES) += orinoco.o 7 7 obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
+98
drivers/net/wireless/orinoco/cfg.c
··· 1 + /* cfg80211 support 2 + * 3 + * See copyright notice in main.c 4 + */ 5 + #include <linux/ieee80211.h> 6 + #include <net/cfg80211.h> 7 + #include "hw.h" 8 + #include "main.h" 9 + #include "orinoco.h" 10 + 11 + #include "cfg.h" 12 + 13 + /* Supported bitrates. Must agree with hw.c */ 14 + static struct ieee80211_rate orinoco_rates[] = { 15 + { .bitrate = 10 }, 16 + { .bitrate = 20 }, 17 + { .bitrate = 55 }, 18 + { .bitrate = 110 }, 19 + }; 20 + 21 + static const void * const orinoco_wiphy_privid = &orinoco_wiphy_privid; 22 + 23 + /* Called after orinoco_private is allocated. */ 24 + void orinoco_wiphy_init(struct wiphy *wiphy) 25 + { 26 + struct orinoco_private *priv = wiphy_priv(wiphy); 27 + 28 + wiphy->privid = orinoco_wiphy_privid; 29 + 30 + set_wiphy_dev(wiphy, priv->dev); 31 + } 32 + 33 + /* Called after firmware is initialised */ 34 + int orinoco_wiphy_register(struct wiphy *wiphy) 35 + { 36 + struct orinoco_private *priv = wiphy_priv(wiphy); 37 + int i, channels = 0; 38 + 39 + if (priv->firmware_type == FIRMWARE_TYPE_AGERE) 40 + wiphy->max_scan_ssids = 1; 41 + else 42 + wiphy->max_scan_ssids = 0; 43 + 44 + wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); 45 + 46 + /* TODO: should we set if we only have demo ad-hoc? 47 + * (priv->has_port3) 48 + */ 49 + if (priv->has_ibss) 50 + wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC); 51 + 52 + if (!priv->broken_monitor || force_monitor) 53 + wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR); 54 + 55 + priv->band.bitrates = orinoco_rates; 56 + priv->band.n_bitrates = ARRAY_SIZE(orinoco_rates); 57 + 58 + /* Only support channels allowed by the card EEPROM */ 59 + for (i = 0; i < NUM_CHANNELS; i++) { 60 + if (priv->channel_mask & (1 << i)) { 61 + priv->channels[i].center_freq = 62 + ieee80211_dsss_chan_to_freq(i+1); 63 + channels++; 64 + } 65 + } 66 + priv->band.channels = priv->channels; 67 + priv->band.n_channels = channels; 68 + 69 + wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; 70 + wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; 71 + 72 + i = 0; 73 + if (priv->has_wep) { 74 + priv->cipher_suites[i] = WLAN_CIPHER_SUITE_WEP40; 75 + i++; 76 + 77 + if (priv->has_big_wep) { 78 + priv->cipher_suites[i] = WLAN_CIPHER_SUITE_WEP104; 79 + i++; 80 + } 81 + } 82 + if (priv->has_wpa) { 83 + priv->cipher_suites[i] = WLAN_CIPHER_SUITE_TKIP; 84 + i++; 85 + } 86 + wiphy->cipher_suites = priv->cipher_suites; 87 + wiphy->n_cipher_suites = i; 88 + 89 + wiphy->rts_threshold = priv->rts_thresh; 90 + if (!priv->has_mwo) 91 + wiphy->frag_threshold = priv->frag_thresh; 92 + 93 + return wiphy_register(wiphy); 94 + } 95 + 96 + const struct cfg80211_ops orinoco_cfg_ops = { 97 + 98 + };
+15
drivers/net/wireless/orinoco/cfg.h
··· 1 + /* cfg80211 support. 2 + * 3 + * See copyright notice in main.c 4 + */ 5 + #ifndef ORINOCO_CFG_H 6 + #define ORINOCO_CFG_H 7 + 8 + #include <net/cfg80211.h> 9 + 10 + extern const struct cfg80211_ops orinoco_cfg_ops; 11 + 12 + void orinoco_wiphy_init(struct wiphy *wiphy); 13 + int orinoco_wiphy_register(struct wiphy *wiphy); 14 + 15 + #endif /* ORINOCO_CFG_H */
+84 -24
drivers/net/wireless/orinoco/main.c
··· 89 89 #include <linux/wireless.h> 90 90 #include <linux/ieee80211.h> 91 91 #include <net/iw_handler.h> 92 + #include <net/cfg80211.h> 92 93 93 94 #include "hermes_rid.h" 94 95 #include "hermes_dld.h" ··· 98 97 #include "mic.h" 99 98 #include "fw.h" 100 99 #include "wext.h" 100 + #include "cfg.h" 101 101 #include "main.h" 102 102 103 103 #include "orinoco.h" ··· 248 246 249 247 static int orinoco_open(struct net_device *dev) 250 248 { 251 - struct orinoco_private *priv = netdev_priv(dev); 249 + struct orinoco_private *priv = ndev_priv(dev); 252 250 unsigned long flags; 253 251 int err; 254 252 ··· 267 265 268 266 static int orinoco_stop(struct net_device *dev) 269 267 { 270 - struct orinoco_private *priv = netdev_priv(dev); 268 + struct orinoco_private *priv = ndev_priv(dev); 271 269 int err = 0; 272 270 273 271 /* We mustn't use orinoco_lock() here, because we need to be ··· 286 284 287 285 static struct net_device_stats *orinoco_get_stats(struct net_device *dev) 288 286 { 289 - struct orinoco_private *priv = netdev_priv(dev); 287 + struct orinoco_private *priv = ndev_priv(dev); 290 288 291 289 return &priv->stats; 292 290 } 293 291 294 292 static void orinoco_set_multicast_list(struct net_device *dev) 295 293 { 296 - struct orinoco_private *priv = netdev_priv(dev); 294 + struct orinoco_private *priv = ndev_priv(dev); 297 295 unsigned long flags; 298 296 299 297 if (orinoco_lock(priv, &flags) != 0) { ··· 308 306 309 307 static int orinoco_change_mtu(struct net_device *dev, int new_mtu) 310 308 { 311 - struct orinoco_private *priv = netdev_priv(dev); 309 + struct orinoco_private *priv = ndev_priv(dev); 312 310 313 311 if ((new_mtu < ORINOCO_MIN_MTU) || (new_mtu > ORINOCO_MAX_MTU)) 314 312 return -EINVAL; ··· 329 327 330 328 static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) 331 329 { 332 - struct orinoco_private *priv = netdev_priv(dev); 330 + struct orinoco_private *priv = ndev_priv(dev); 333 331 struct net_device_stats *stats = &priv->stats; 334 332 hermes_t *hw = &priv->hw; 335 333 int err = 0; ··· 519 517 520 518 static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw) 521 519 { 522 - struct orinoco_private *priv = netdev_priv(dev); 520 + struct orinoco_private *priv = ndev_priv(dev); 523 521 u16 fid = hermes_read_regn(hw, ALLOCFID); 524 522 525 523 if (fid != priv->txfid) { ··· 534 532 535 533 static void __orinoco_ev_tx(struct net_device *dev, hermes_t *hw) 536 534 { 537 - struct orinoco_private *priv = netdev_priv(dev); 535 + struct orinoco_private *priv = ndev_priv(dev); 538 536 struct net_device_stats *stats = &priv->stats; 539 537 540 538 stats->tx_packets++; ··· 546 544 547 545 static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw) 548 546 { 549 - struct orinoco_private *priv = netdev_priv(dev); 547 + struct orinoco_private *priv = ndev_priv(dev); 550 548 struct net_device_stats *stats = &priv->stats; 551 549 u16 fid = hermes_read_regn(hw, TXCOMPLFID); 552 550 u16 status; ··· 602 600 603 601 static void orinoco_tx_timeout(struct net_device *dev) 604 602 { 605 - struct orinoco_private *priv = netdev_priv(dev); 603 + struct orinoco_private *priv = ndev_priv(dev); 606 604 struct net_device_stats *stats = &priv->stats; 607 605 struct hermes *hw = &priv->hw; 608 606 ··· 651 649 struct sk_buff *skb, 652 650 struct hermes_rx_descriptor *desc) 653 651 { 654 - struct orinoco_private *priv = netdev_priv(dev); 652 + struct orinoco_private *priv = ndev_priv(dev); 655 653 656 654 /* Using spy support with lots of Rx packets, like in an 657 655 * infrastructure (AP), will really slow down everything, because ··· 688 686 int err; 689 687 int len; 690 688 struct sk_buff *skb; 691 - struct orinoco_private *priv = netdev_priv(dev); 689 + struct orinoco_private *priv = ndev_priv(dev); 692 690 struct net_device_stats *stats = &priv->stats; 693 691 hermes_t *hw = &priv->hw; 694 692 ··· 779 777 780 778 static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw) 781 779 { 782 - struct orinoco_private *priv = netdev_priv(dev); 780 + struct orinoco_private *priv = ndev_priv(dev); 783 781 struct net_device_stats *stats = &priv->stats; 784 782 struct iw_statistics *wstats = &priv->wstats; 785 783 struct sk_buff *skb = NULL; ··· 903 901 struct hermes_rx_descriptor *desc, 904 902 struct sk_buff *skb) 905 903 { 906 - struct orinoco_private *priv = netdev_priv(dev); 904 + struct orinoco_private *priv = ndev_priv(dev); 907 905 struct net_device_stats *stats = &priv->stats; 908 906 u16 status, fc; 909 907 int length; ··· 1018 1016 static void orinoco_rx_isr_tasklet(unsigned long data) 1019 1017 { 1020 1018 struct net_device *dev = (struct net_device *) data; 1021 - struct orinoco_private *priv = netdev_priv(dev); 1019 + struct orinoco_private *priv = ndev_priv(dev); 1022 1020 struct orinoco_rx_data *rx_data, *temp; 1023 1021 struct hermes_rx_descriptor *desc; 1024 1022 struct sk_buff *skb; ··· 1263 1261 1264 1262 static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) 1265 1263 { 1266 - struct orinoco_private *priv = netdev_priv(dev); 1264 + struct orinoco_private *priv = ndev_priv(dev); 1267 1265 u16 infofid; 1268 1266 struct { 1269 1267 __le16 len; ··· 1596 1594 1597 1595 int __orinoco_program_rids(struct net_device *dev) 1598 1596 { 1599 - struct orinoco_private *priv = netdev_priv(dev); 1597 + struct orinoco_private *priv = ndev_priv(dev); 1600 1598 hermes_t *hw = &priv->hw; 1601 1599 int err; 1602 1600 struct hermes_idstring idbuf; ··· 1827 1825 static void 1828 1826 __orinoco_set_multicast_list(struct net_device *dev) 1829 1827 { 1830 - struct orinoco_private *priv = netdev_priv(dev); 1828 + struct orinoco_private *priv = ndev_priv(dev); 1831 1829 int err = 0; 1832 1830 int promisc, mc_count; 1833 1831 ··· 2079 2077 int orinoco_init(struct orinoco_private *priv) 2080 2078 { 2081 2079 struct device *dev = priv->dev; 2080 + struct wiphy *wiphy = priv_to_wiphy(priv); 2082 2081 hermes_t *hw = &priv->hw; 2083 2082 int err = 0; 2084 2083 ··· 2140 2137 goto out; 2141 2138 orinoco_bss_data_init(priv); 2142 2139 2143 - /* Netdev has not initialised, but we have allocated the buffer. */ 2144 - err = orinoco_hw_read_card_settings(priv, priv->ndev->dev_addr); 2140 + err = orinoco_hw_read_card_settings(priv, wiphy->perm_addr); 2145 2141 if (err) 2146 2142 goto out; 2143 + memcpy(priv->ndev->dev_addr, wiphy->perm_addr, ETH_ALEN); 2147 2144 2148 2145 err = orinoco_hw_allocate_fid(priv); 2149 2146 if (err) { ··· 2166 2163 priv->key_mgmt = 0; 2167 2164 priv->wpa_ie_len = 0; 2168 2165 priv->wpa_ie = NULL; 2166 + 2167 + if (orinoco_wiphy_register(wiphy)) { 2168 + err = -ENODEV; 2169 + goto out; 2170 + } 2169 2171 2170 2172 /* Make the hardware available, as long as it hasn't been 2171 2173 * removed elsewhere (e.g. by PCMCIA hot unplug) */ ··· 2195 2187 .ndo_get_stats = orinoco_get_stats, 2196 2188 }; 2197 2189 2190 + /* Allocate private data. 2191 + * 2192 + * This driver has a number of structures associated with it 2193 + * netdev - Net device structure for each network interface 2194 + * wiphy - structure associated with wireless phy 2195 + * wireless_dev (wdev) - structure for each wireless interface 2196 + * hw - structure for hermes chip info 2197 + * card - card specific structure for use by the card driver 2198 + * (airport, orinoco_cs) 2199 + * priv - orinoco private data 2200 + * device - generic linux device structure 2201 + * 2202 + * +---------+ +---------+ 2203 + * | wiphy | | netdev | 2204 + * | +-------+ | +-------+ 2205 + * | | priv | | | wdev | 2206 + * | | +-----+ +-+-------+ 2207 + * | | | hw | 2208 + * | +-+-----+ 2209 + * | | card | 2210 + * +-+-------+ 2211 + * 2212 + * priv has a link to netdev and device 2213 + * wdev has a link to wiphy 2214 + */ 2198 2215 struct orinoco_private 2199 2216 *alloc_orinocodev(int sizeof_card, 2200 2217 struct device *device, ··· 2228 2195 { 2229 2196 struct net_device *dev; 2230 2197 struct orinoco_private *priv; 2198 + struct wireless_dev *wdev; 2199 + struct wiphy *wiphy; 2231 2200 2232 - dev = alloc_etherdev(sizeof(struct orinoco_private) + sizeof_card); 2233 - if (!dev) 2201 + /* allocate wiphy 2202 + * NOTE: We only support a single virtual interface 2203 + * but this may change when monitor mode is added 2204 + */ 2205 + wiphy = wiphy_new(&orinoco_cfg_ops, 2206 + sizeof(struct orinoco_private) + sizeof_card); 2207 + if (!wiphy) 2234 2208 return NULL; 2235 - priv = netdev_priv(dev); 2209 + 2210 + dev = alloc_etherdev(sizeof(struct wireless_dev)); 2211 + if (!dev) { 2212 + wiphy_free(wiphy); 2213 + return NULL; 2214 + } 2215 + 2216 + priv = wiphy_priv(wiphy); 2236 2217 priv->ndev = dev; 2218 + 2237 2219 if (sizeof_card) 2238 2220 priv->card = (void *)((unsigned long)priv 2239 2221 + sizeof(struct orinoco_private)); ··· 2256 2208 priv->card = NULL; 2257 2209 priv->dev = device; 2258 2210 2211 + orinoco_wiphy_init(wiphy); 2212 + 2213 + /* Initialise wireless_dev */ 2214 + wdev = netdev_priv(dev); 2215 + wdev->wiphy = wiphy; 2216 + wdev->iftype = NL80211_IFTYPE_STATION; 2217 + 2259 2218 /* Setup / override net_device fields */ 2219 + dev->ieee80211_ptr = wdev; 2260 2220 dev->netdev_ops = &orinoco_netdev_ops; 2261 2221 dev->watchdog_timeo = HZ; /* 1 second timeout */ 2262 2222 dev->ethtool_ops = &orinoco_ethtool_ops; ··· 2313 2257 void free_orinocodev(struct orinoco_private *priv) 2314 2258 { 2315 2259 struct net_device *dev = priv->ndev; 2260 + struct wiphy *wiphy = priv_to_wiphy(priv); 2316 2261 struct orinoco_rx_data *rx_data, *temp; 2262 + 2263 + wiphy_unregister(wiphy); 2317 2264 2318 2265 /* If the tasklet is scheduled when we call tasklet_kill it 2319 2266 * will run one final time. However the tasklet will only ··· 2340 2281 orinoco_mic_free(priv); 2341 2282 orinoco_bss_data_free(priv); 2342 2283 free_netdev(dev); 2284 + wiphy_free(wiphy); 2343 2285 } 2344 2286 EXPORT_SYMBOL(free_orinocodev); 2345 2287 2346 2288 static void orinoco_get_drvinfo(struct net_device *dev, 2347 2289 struct ethtool_drvinfo *info) 2348 2290 { 2349 - struct orinoco_private *priv = netdev_priv(dev); 2291 + struct orinoco_private *priv = ndev_priv(dev); 2350 2292 2351 2293 strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1); 2352 2294 strncpy(info->version, DRIVER_VERSION, sizeof(info->version) - 1);
+11
drivers/net/wireless/orinoco/orinoco.h
··· 14 14 #include <linux/netdevice.h> 15 15 #include <linux/wireless.h> 16 16 #include <net/iw_handler.h> 17 + #include <net/cfg80211.h> 17 18 18 19 #include "hermes.h" 19 20 ··· 67 66 struct device *dev; 68 67 int (*hard_reset)(struct orinoco_private *); 69 68 int (*stop_fw)(struct orinoco_private *, int); 69 + 70 + struct ieee80211_supported_band band; 71 + struct ieee80211_channel channels[14]; 72 + u32 cipher_suites[3]; 70 73 71 74 /* Synchronisation stuff */ 72 75 spinlock_t lock; ··· 221 216 spin_unlock_irqrestore(&priv->lock, *flags); 222 217 } 223 218 219 + /*** Navigate from net_device to orinoco_private ***/ 220 + static inline struct orinoco_private *ndev_priv(struct net_device *dev) 221 + { 222 + struct wireless_dev *wdev = netdev_priv(dev); 223 + return wdev_priv(wdev); 224 + } 224 225 #endif /* _ORINOCO_H */
+46 -64
drivers/net/wireless/orinoco/wext.c
··· 7 7 #include <linux/wireless.h> 8 8 #include <linux/ieee80211.h> 9 9 #include <net/iw_handler.h> 10 + #include <net/cfg80211.h> 10 11 11 12 #include "hermes.h" 12 13 #include "hermes_rid.h" ··· 24 23 25 24 static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) 26 25 { 27 - struct orinoco_private *priv = netdev_priv(dev); 26 + struct orinoco_private *priv = ndev_priv(dev); 28 27 hermes_t *hw = &priv->hw; 29 28 struct iw_statistics *wstats = &priv->wstats; 30 29 int err; ··· 88 87 /* Wireless extensions */ 89 88 /********************************************************************/ 90 89 91 - static int orinoco_ioctl_getname(struct net_device *dev, 92 - struct iw_request_info *info, 93 - char *name, 94 - char *extra) 95 - { 96 - struct orinoco_private *priv = netdev_priv(dev); 97 - int numrates; 98 - int err; 99 - 100 - err = orinoco_hw_get_bitratelist(priv, &numrates, NULL, 0); 101 - 102 - if (!err && (numrates > 2)) 103 - strcpy(name, "IEEE 802.11b"); 104 - else 105 - strcpy(name, "IEEE 802.11-DS"); 106 - 107 - return 0; 108 - } 109 - 110 90 static int orinoco_ioctl_setwap(struct net_device *dev, 111 91 struct iw_request_info *info, 112 92 struct sockaddr *ap_addr, 113 93 char *extra) 114 94 { 115 - struct orinoco_private *priv = netdev_priv(dev); 95 + struct orinoco_private *priv = ndev_priv(dev); 116 96 int err = -EINPROGRESS; /* Call commit handler */ 117 97 unsigned long flags; 118 98 static const u8 off_addr[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; ··· 154 172 struct sockaddr *ap_addr, 155 173 char *extra) 156 174 { 157 - struct orinoco_private *priv = netdev_priv(dev); 175 + struct orinoco_private *priv = ndev_priv(dev); 158 176 159 177 hermes_t *hw = &priv->hw; 160 178 int err = 0; ··· 177 195 u32 *mode, 178 196 char *extra) 179 197 { 180 - struct orinoco_private *priv = netdev_priv(dev); 198 + struct orinoco_private *priv = ndev_priv(dev); 181 199 int err = -EINPROGRESS; /* Call commit handler */ 182 200 unsigned long flags; 183 201 ··· 225 243 u32 *mode, 226 244 char *extra) 227 245 { 228 - struct orinoco_private *priv = netdev_priv(dev); 246 + struct orinoco_private *priv = ndev_priv(dev); 229 247 230 248 *mode = priv->iw_mode; 231 249 return 0; ··· 236 254 struct iw_point *rrq, 237 255 char *extra) 238 256 { 239 - struct orinoco_private *priv = netdev_priv(dev); 257 + struct orinoco_private *priv = ndev_priv(dev); 240 258 int err = 0; 241 259 struct iw_range *range = (struct iw_range *) extra; 242 260 int numrates; ··· 349 367 struct iw_point *erq, 350 368 char *keybuf) 351 369 { 352 - struct orinoco_private *priv = netdev_priv(dev); 370 + struct orinoco_private *priv = ndev_priv(dev); 353 371 int index = (erq->flags & IW_ENCODE_INDEX) - 1; 354 372 int setindex = priv->tx_key; 355 373 int encode_alg = priv->encode_alg; ··· 451 469 struct iw_point *erq, 452 470 char *keybuf) 453 471 { 454 - struct orinoco_private *priv = netdev_priv(dev); 472 + struct orinoco_private *priv = ndev_priv(dev); 455 473 int index = (erq->flags & IW_ENCODE_INDEX) - 1; 456 474 u16 xlen = 0; 457 475 unsigned long flags; ··· 490 508 struct iw_point *erq, 491 509 char *essidbuf) 492 510 { 493 - struct orinoco_private *priv = netdev_priv(dev); 511 + struct orinoco_private *priv = ndev_priv(dev); 494 512 unsigned long flags; 495 513 496 514 /* Note : ESSID is ignored in Ad-Hoc demo mode, but we can set it ··· 521 539 struct iw_point *erq, 522 540 char *essidbuf) 523 541 { 524 - struct orinoco_private *priv = netdev_priv(dev); 542 + struct orinoco_private *priv = ndev_priv(dev); 525 543 int active; 526 544 int err = 0; 527 545 unsigned long flags; ··· 549 567 struct iw_point *nrq, 550 568 char *nickbuf) 551 569 { 552 - struct orinoco_private *priv = netdev_priv(dev); 570 + struct orinoco_private *priv = ndev_priv(dev); 553 571 unsigned long flags; 554 572 555 573 if (nrq->length > IW_ESSID_MAX_SIZE) ··· 571 589 struct iw_point *nrq, 572 590 char *nickbuf) 573 591 { 574 - struct orinoco_private *priv = netdev_priv(dev); 592 + struct orinoco_private *priv = ndev_priv(dev); 575 593 unsigned long flags; 576 594 577 595 if (orinoco_lock(priv, &flags) != 0) ··· 590 608 struct iw_freq *frq, 591 609 char *extra) 592 610 { 593 - struct orinoco_private *priv = netdev_priv(dev); 611 + struct orinoco_private *priv = ndev_priv(dev); 594 612 int chan = -1; 595 613 unsigned long flags; 596 614 int err = -EINPROGRESS; /* Call commit handler */ ··· 639 657 struct iw_freq *frq, 640 658 char *extra) 641 659 { 642 - struct orinoco_private *priv = netdev_priv(dev); 660 + struct orinoco_private *priv = ndev_priv(dev); 643 661 int tmp; 644 662 645 663 /* Locking done in there */ ··· 658 676 struct iw_param *srq, 659 677 char *extra) 660 678 { 661 - struct orinoco_private *priv = netdev_priv(dev); 679 + struct orinoco_private *priv = ndev_priv(dev); 662 680 hermes_t *hw = &priv->hw; 663 681 u16 val; 664 682 int err; ··· 687 705 struct iw_param *srq, 688 706 char *extra) 689 707 { 690 - struct orinoco_private *priv = netdev_priv(dev); 708 + struct orinoco_private *priv = ndev_priv(dev); 691 709 int val = srq->value; 692 710 unsigned long flags; 693 711 ··· 710 728 struct iw_param *rrq, 711 729 char *extra) 712 730 { 713 - struct orinoco_private *priv = netdev_priv(dev); 731 + struct orinoco_private *priv = ndev_priv(dev); 714 732 int val = rrq->value; 715 733 unsigned long flags; 716 734 ··· 734 752 struct iw_param *rrq, 735 753 char *extra) 736 754 { 737 - struct orinoco_private *priv = netdev_priv(dev); 755 + struct orinoco_private *priv = ndev_priv(dev); 738 756 739 757 rrq->value = priv->rts_thresh; 740 758 rrq->disabled = (rrq->value == 2347); ··· 748 766 struct iw_param *frq, 749 767 char *extra) 750 768 { 751 - struct orinoco_private *priv = netdev_priv(dev); 769 + struct orinoco_private *priv = ndev_priv(dev); 752 770 int err = -EINPROGRESS; /* Call commit handler */ 753 771 unsigned long flags; 754 772 ··· 788 806 struct iw_param *frq, 789 807 char *extra) 790 808 { 791 - struct orinoco_private *priv = netdev_priv(dev); 809 + struct orinoco_private *priv = ndev_priv(dev); 792 810 hermes_t *hw = &priv->hw; 793 811 int err; 794 812 u16 val; ··· 829 847 struct iw_param *rrq, 830 848 char *extra) 831 849 { 832 - struct orinoco_private *priv = netdev_priv(dev); 850 + struct orinoco_private *priv = ndev_priv(dev); 833 851 int ratemode; 834 852 int bitrate; /* 100s of kilobits */ 835 853 unsigned long flags; ··· 863 881 struct iw_param *rrq, 864 882 char *extra) 865 883 { 866 - struct orinoco_private *priv = netdev_priv(dev); 884 + struct orinoco_private *priv = ndev_priv(dev); 867 885 int err = 0; 868 886 int bitrate, automatic; 869 887 unsigned long flags; ··· 892 910 struct iw_param *prq, 893 911 char *extra) 894 912 { 895 - struct orinoco_private *priv = netdev_priv(dev); 913 + struct orinoco_private *priv = ndev_priv(dev); 896 914 int err = -EINPROGRESS; /* Call commit handler */ 897 915 unsigned long flags; 898 916 ··· 946 964 struct iw_param *prq, 947 965 char *extra) 948 966 { 949 - struct orinoco_private *priv = netdev_priv(dev); 967 + struct orinoco_private *priv = ndev_priv(dev); 950 968 hermes_t *hw = &priv->hw; 951 969 int err = 0; 952 970 u16 enable, period, timeout, mcast; ··· 1000 1018 union iwreq_data *wrqu, 1001 1019 char *extra) 1002 1020 { 1003 - struct orinoco_private *priv = netdev_priv(dev); 1021 + struct orinoco_private *priv = ndev_priv(dev); 1004 1022 struct iw_point *encoding = &wrqu->encoding; 1005 1023 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 1006 1024 int idx, alg = ext->alg, set_key = 1; ··· 1101 1119 union iwreq_data *wrqu, 1102 1120 char *extra) 1103 1121 { 1104 - struct orinoco_private *priv = netdev_priv(dev); 1122 + struct orinoco_private *priv = ndev_priv(dev); 1105 1123 struct iw_point *encoding = &wrqu->encoding; 1106 1124 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 1107 1125 int idx, max_key_len; ··· 1158 1176 struct iw_request_info *info, 1159 1177 union iwreq_data *wrqu, char *extra) 1160 1178 { 1161 - struct orinoco_private *priv = netdev_priv(dev); 1179 + struct orinoco_private *priv = ndev_priv(dev); 1162 1180 hermes_t *hw = &priv->hw; 1163 1181 struct iw_param *param = &wrqu->param; 1164 1182 unsigned long flags; ··· 1236 1254 struct iw_request_info *info, 1237 1255 union iwreq_data *wrqu, char *extra) 1238 1256 { 1239 - struct orinoco_private *priv = netdev_priv(dev); 1257 + struct orinoco_private *priv = ndev_priv(dev); 1240 1258 struct iw_param *param = &wrqu->param; 1241 1259 unsigned long flags; 1242 1260 int ret = 0; ··· 1276 1294 struct iw_request_info *info, 1277 1295 union iwreq_data *wrqu, char *extra) 1278 1296 { 1279 - struct orinoco_private *priv = netdev_priv(dev); 1297 + struct orinoco_private *priv = ndev_priv(dev); 1280 1298 u8 *buf; 1281 1299 unsigned long flags; 1282 1300 ··· 1319 1337 struct iw_request_info *info, 1320 1338 union iwreq_data *wrqu, char *extra) 1321 1339 { 1322 - struct orinoco_private *priv = netdev_priv(dev); 1340 + struct orinoco_private *priv = ndev_priv(dev); 1323 1341 unsigned long flags; 1324 1342 int err = 0; 1325 1343 ··· 1348 1366 struct iw_request_info *info, 1349 1367 union iwreq_data *wrqu, char *extra) 1350 1368 { 1351 - struct orinoco_private *priv = netdev_priv(dev); 1369 + struct orinoco_private *priv = ndev_priv(dev); 1352 1370 hermes_t *hw = &priv->hw; 1353 1371 struct iw_mlme *mlme = (struct iw_mlme *)extra; 1354 1372 unsigned long flags; ··· 1389 1407 struct iw_param *rrq, 1390 1408 char *extra) 1391 1409 { 1392 - struct orinoco_private *priv = netdev_priv(dev); 1410 + struct orinoco_private *priv = ndev_priv(dev); 1393 1411 hermes_t *hw = &priv->hw; 1394 1412 int err = 0; 1395 1413 u16 short_limit, long_limit, lifetime; ··· 1443 1461 void *wrqu, 1444 1462 char *extra) 1445 1463 { 1446 - struct orinoco_private *priv = netdev_priv(dev); 1464 + struct orinoco_private *priv = ndev_priv(dev); 1447 1465 1448 1466 if (!capable(CAP_NET_ADMIN)) 1449 1467 return -EPERM; ··· 1468 1486 char *extra) 1469 1487 1470 1488 { 1471 - struct orinoco_private *priv = netdev_priv(dev); 1489 + struct orinoco_private *priv = ndev_priv(dev); 1472 1490 int val = *((int *) extra); 1473 1491 unsigned long flags; 1474 1492 ··· 1489 1507 void *wrqu, 1490 1508 char *extra) 1491 1509 { 1492 - struct orinoco_private *priv = netdev_priv(dev); 1510 + struct orinoco_private *priv = ndev_priv(dev); 1493 1511 int *val = (int *) extra; 1494 1512 1495 1513 *val = priv->ibss_port; ··· 1501 1519 void *wrqu, 1502 1520 char *extra) 1503 1521 { 1504 - struct orinoco_private *priv = netdev_priv(dev); 1522 + struct orinoco_private *priv = ndev_priv(dev); 1505 1523 int val = *((int *) extra); 1506 1524 int err = 0; 1507 1525 unsigned long flags; ··· 1547 1565 void *wrqu, 1548 1566 char *extra) 1549 1567 { 1550 - struct orinoco_private *priv = netdev_priv(dev); 1568 + struct orinoco_private *priv = ndev_priv(dev); 1551 1569 int *val = (int *) extra; 1552 1570 1553 1571 *val = priv->prefer_port3; ··· 1559 1577 void *wrqu, 1560 1578 char *extra) 1561 1579 { 1562 - struct orinoco_private *priv = netdev_priv(dev); 1580 + struct orinoco_private *priv = ndev_priv(dev); 1563 1581 unsigned long flags; 1564 1582 int val; 1565 1583 ··· 1591 1609 void *wrqu, 1592 1610 char *extra) 1593 1611 { 1594 - struct orinoco_private *priv = netdev_priv(dev); 1612 + struct orinoco_private *priv = ndev_priv(dev); 1595 1613 int *val = (int *) extra; 1596 1614 1597 1615 if (!priv->has_preamble) ··· 1611 1629 struct iw_point *data, 1612 1630 char *extra) 1613 1631 { 1614 - struct orinoco_private *priv = netdev_priv(dev); 1632 + struct orinoco_private *priv = ndev_priv(dev); 1615 1633 hermes_t *hw = &priv->hw; 1616 1634 int rid = data->flags; 1617 1635 u16 length; ··· 1648 1666 struct iw_point *srq, 1649 1667 char *extra) 1650 1668 { 1651 - struct orinoco_private *priv = netdev_priv(dev); 1669 + struct orinoco_private *priv = ndev_priv(dev); 1652 1670 hermes_t *hw = &priv->hw; 1653 1671 struct iw_scan_req *si = (struct iw_scan_req *) extra; 1654 1672 int err = 0; ··· 1773 1791 union hermes_scan_info *bss, 1774 1792 unsigned long last_scanned) 1775 1793 { 1776 - struct orinoco_private *priv = netdev_priv(dev); 1794 + struct orinoco_private *priv = ndev_priv(dev); 1777 1795 u16 capabilities; 1778 1796 u16 channel; 1779 1797 struct iw_event iwe; /* Temporary buffer */ ··· 2084 2102 struct iw_point *srq, 2085 2103 char *extra) 2086 2104 { 2087 - struct orinoco_private *priv = netdev_priv(dev); 2105 + struct orinoco_private *priv = ndev_priv(dev); 2088 2106 int err = 0; 2089 2107 unsigned long flags; 2090 2108 char *current_ev = extra; ··· 2162 2180 void *wrqu, 2163 2181 char *extra) 2164 2182 { 2165 - struct orinoco_private *priv = netdev_priv(dev); 2183 + struct orinoco_private *priv = ndev_priv(dev); 2166 2184 struct hermes *hw = &priv->hw; 2167 2185 unsigned long flags; 2168 2186 int err = 0; ··· 2239 2257 [IW_IOCTL_IDX(id)] = (iw_handler) func 2240 2258 static const iw_handler orinoco_handler[] = { 2241 2259 STD_IW_HANDLER(SIOCSIWCOMMIT, orinoco_ioctl_commit), 2242 - STD_IW_HANDLER(SIOCGIWNAME, orinoco_ioctl_getname), 2260 + STD_IW_HANDLER(SIOCGIWNAME, cfg80211_wext_giwname), 2243 2261 STD_IW_HANDLER(SIOCSIWFREQ, orinoco_ioctl_setfreq), 2244 2262 STD_IW_HANDLER(SIOCGIWFREQ, orinoco_ioctl_getfreq), 2245 2263 STD_IW_HANDLER(SIOCSIWMODE, orinoco_ioctl_setmode),