diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/orinoco.c | 332 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco.h | 1 |
2 files changed, 69 insertions, 264 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index a3a32430ae9d..b1078baa1d5e 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -492,6 +492,9 @@ EXPORT_SYMBOL(orinoco_debug); | |||
492 | static int suppress_linkstatus; /* = 0 */ | 492 | static int suppress_linkstatus; /* = 0 */ |
493 | module_param(suppress_linkstatus, bool, 0644); | 493 | module_param(suppress_linkstatus, bool, 0644); |
494 | MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes"); | 494 | MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes"); |
495 | static int ignore_disconnect; /* = 0 */ | ||
496 | module_param(ignore_disconnect, int, 0644); | ||
497 | MODULE_PARM_DESC(ignore_disconnect, "Don't report lost link to the network layer"); | ||
495 | 498 | ||
496 | /********************************************************************/ | 499 | /********************************************************************/ |
497 | /* Compile time configuration and compatibility stuff */ | 500 | /* Compile time configuration and compatibility stuff */ |
@@ -604,7 +607,6 @@ struct hermes_rx_descriptor { | |||
604 | static int orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 607 | static int orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
605 | static int __orinoco_program_rids(struct net_device *dev); | 608 | static int __orinoco_program_rids(struct net_device *dev); |
606 | static void __orinoco_set_multicast_list(struct net_device *dev); | 609 | static void __orinoco_set_multicast_list(struct net_device *dev); |
607 | static int orinoco_debug_dump_recs(struct net_device *dev); | ||
608 | 610 | ||
609 | /********************************************************************/ | 611 | /********************************************************************/ |
610 | /* Internal helper functions */ | 612 | /* Internal helper functions */ |
@@ -655,7 +657,7 @@ static int orinoco_open(struct net_device *dev) | |||
655 | return err; | 657 | return err; |
656 | } | 658 | } |
657 | 659 | ||
658 | int orinoco_stop(struct net_device *dev) | 660 | static int orinoco_stop(struct net_device *dev) |
659 | { | 661 | { |
660 | struct orinoco_private *priv = netdev_priv(dev); | 662 | struct orinoco_private *priv = netdev_priv(dev); |
661 | int err = 0; | 663 | int err = 0; |
@@ -686,7 +688,7 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) | |||
686 | struct orinoco_private *priv = netdev_priv(dev); | 688 | struct orinoco_private *priv = netdev_priv(dev); |
687 | hermes_t *hw = &priv->hw; | 689 | hermes_t *hw = &priv->hw; |
688 | struct iw_statistics *wstats = &priv->wstats; | 690 | struct iw_statistics *wstats = &priv->wstats; |
689 | int err = 0; | 691 | int err; |
690 | unsigned long flags; | 692 | unsigned long flags; |
691 | 693 | ||
692 | if (! netif_device_present(dev)) { | 694 | if (! netif_device_present(dev)) { |
@@ -695,9 +697,21 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) | |||
695 | return NULL; /* FIXME: Can we do better than this? */ | 697 | return NULL; /* FIXME: Can we do better than this? */ |
696 | } | 698 | } |
697 | 699 | ||
700 | /* If busy, return the old stats. Returning NULL may cause | ||
701 | * the interface to disappear from /proc/net/wireless */ | ||
698 | if (orinoco_lock(priv, &flags) != 0) | 702 | if (orinoco_lock(priv, &flags) != 0) |
699 | return NULL; /* FIXME: Erg, we've been signalled, how | 703 | return wstats; |
700 | * do we propagate this back up? */ | 704 | |
705 | /* We can't really wait for the tallies inquiry command to | ||
706 | * complete, so we just use the previous results and trigger | ||
707 | * a new tallies inquiry command for next time - Jean II */ | ||
708 | /* FIXME: Really we should wait for the inquiry to come back - | ||
709 | * as it is the stats we give don't make a whole lot of sense. | ||
710 | * Unfortunately, it's not clear how to do that within the | ||
711 | * wireless extensions framework: I think we're in user | ||
712 | * context, but a lock seems to be held by the time we get in | ||
713 | * here so we're not safe to sleep here. */ | ||
714 | hermes_inquire(hw, HERMES_INQ_TALLIES); | ||
701 | 715 | ||
702 | if (priv->iw_mode == IW_MODE_ADHOC) { | 716 | if (priv->iw_mode == IW_MODE_ADHOC) { |
703 | memset(&wstats->qual, 0, sizeof(wstats->qual)); | 717 | memset(&wstats->qual, 0, sizeof(wstats->qual)); |
@@ -716,25 +730,16 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev) | |||
716 | 730 | ||
717 | err = HERMES_READ_RECORD(hw, USER_BAP, | 731 | err = HERMES_READ_RECORD(hw, USER_BAP, |
718 | HERMES_RID_COMMSQUALITY, &cq); | 732 | HERMES_RID_COMMSQUALITY, &cq); |
719 | 733 | ||
720 | wstats->qual.qual = (int)le16_to_cpu(cq.qual); | 734 | if (!err) { |
721 | wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95; | 735 | wstats->qual.qual = (int)le16_to_cpu(cq.qual); |
722 | wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95; | 736 | wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95; |
723 | wstats->qual.updated = 7; | 737 | wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95; |
738 | wstats->qual.updated = 7; | ||
739 | } | ||
724 | } | 740 | } |
725 | 741 | ||
726 | /* We can't really wait for the tallies inquiry command to | ||
727 | * complete, so we just use the previous results and trigger | ||
728 | * a new tallies inquiry command for next time - Jean II */ | ||
729 | /* FIXME: We're in user context (I think?), so we should just | ||
730 | wait for the tallies to come through */ | ||
731 | err = hermes_inquire(hw, HERMES_INQ_TALLIES); | ||
732 | |||
733 | orinoco_unlock(priv, &flags); | 742 | orinoco_unlock(priv, &flags); |
734 | |||
735 | if (err) | ||
736 | return NULL; | ||
737 | |||
738 | return wstats; | 743 | return wstats; |
739 | } | 744 | } |
740 | 745 | ||
@@ -1275,9 +1280,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1275 | len = sizeof(tallies); | 1280 | len = sizeof(tallies); |
1276 | } | 1281 | } |
1277 | 1282 | ||
1278 | /* Read directly the data (no seek) */ | 1283 | err = hermes_bap_pread(hw, IRQ_BAP, &tallies, len, |
1279 | hermes_read_words(hw, HERMES_DATA1, (void *) &tallies, | 1284 | infofid, sizeof(info)); |
1280 | len / 2); /* FIXME: blech! */ | 1285 | if (err) |
1286 | break; | ||
1281 | 1287 | ||
1282 | /* Increment our various counters */ | 1288 | /* Increment our various counters */ |
1283 | /* wstats->discard.nwid - no wrong BSSID stuff */ | 1289 | /* wstats->discard.nwid - no wrong BSSID stuff */ |
@@ -1307,8 +1313,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1307 | break; | 1313 | break; |
1308 | } | 1314 | } |
1309 | 1315 | ||
1310 | hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus, | 1316 | err = hermes_bap_pread(hw, IRQ_BAP, &linkstatus, len, |
1311 | len / 2); | 1317 | infofid, sizeof(info)); |
1318 | if (err) | ||
1319 | break; | ||
1312 | newstatus = le16_to_cpu(linkstatus.linkstatus); | 1320 | newstatus = le16_to_cpu(linkstatus.linkstatus); |
1313 | 1321 | ||
1314 | connected = (newstatus == HERMES_LINKSTATUS_CONNECTED) | 1322 | connected = (newstatus == HERMES_LINKSTATUS_CONNECTED) |
@@ -1317,7 +1325,7 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw) | |||
1317 | 1325 | ||
1318 | if (connected) | 1326 | if (connected) |
1319 | netif_carrier_on(dev); | 1327 | netif_carrier_on(dev); |
1320 | else | 1328 | else if (!ignore_disconnect) |
1321 | netif_carrier_off(dev); | 1329 | netif_carrier_off(dev); |
1322 | 1330 | ||
1323 | if (newstatus != priv->last_linkstatus) | 1331 | if (newstatus != priv->last_linkstatus) |
@@ -1350,6 +1358,8 @@ int __orinoco_up(struct net_device *dev) | |||
1350 | struct hermes *hw = &priv->hw; | 1358 | struct hermes *hw = &priv->hw; |
1351 | int err; | 1359 | int err; |
1352 | 1360 | ||
1361 | netif_carrier_off(dev); /* just to make sure */ | ||
1362 | |||
1353 | err = __orinoco_program_rids(dev); | 1363 | err = __orinoco_program_rids(dev); |
1354 | if (err) { | 1364 | if (err) { |
1355 | printk(KERN_ERR "%s: Error %d configuring card\n", | 1365 | printk(KERN_ERR "%s: Error %d configuring card\n", |
@@ -1413,7 +1423,7 @@ int orinoco_reinit_firmware(struct net_device *dev) | |||
1413 | return err; | 1423 | return err; |
1414 | 1424 | ||
1415 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | 1425 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); |
1416 | if (err == -EIO) { | 1426 | if (err == -EIO && priv->nicbuf_size > TX_NICBUF_SIZE_BUG) { |
1417 | /* Try workaround for old Symbol firmware bug */ | 1427 | /* Try workaround for old Symbol firmware bug */ |
1418 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " | 1428 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " |
1419 | "(old Symbol firmware?). Trying to work around... ", | 1429 | "(old Symbol firmware?). Trying to work around... ", |
@@ -1610,17 +1620,15 @@ static int __orinoco_program_rids(struct net_device *dev) | |||
1610 | return err; | 1620 | return err; |
1611 | } | 1621 | } |
1612 | /* Set the channel/frequency */ | 1622 | /* Set the channel/frequency */ |
1613 | if (priv->channel == 0) { | 1623 | if (priv->channel != 0 && priv->iw_mode != IW_MODE_INFRA) { |
1614 | printk(KERN_DEBUG "%s: Channel is 0 in __orinoco_program_rids()\n", dev->name); | 1624 | err = hermes_write_wordrec(hw, USER_BAP, |
1615 | if (priv->createibss) | 1625 | HERMES_RID_CNFOWNCHANNEL, |
1616 | priv->channel = 10; | 1626 | priv->channel); |
1617 | } | 1627 | if (err) { |
1618 | err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL, | 1628 | printk(KERN_ERR "%s: Error %d setting channel %d\n", |
1619 | priv->channel); | 1629 | dev->name, err, priv->channel); |
1620 | if (err) { | 1630 | return err; |
1621 | printk(KERN_ERR "%s: Error %d setting channel\n", | 1631 | } |
1622 | dev->name, err); | ||
1623 | return err; | ||
1624 | } | 1632 | } |
1625 | 1633 | ||
1626 | if (priv->has_ibss) { | 1634 | if (priv->has_ibss) { |
@@ -1916,7 +1924,7 @@ static void orinoco_reset(struct net_device *dev) | |||
1916 | { | 1924 | { |
1917 | struct orinoco_private *priv = netdev_priv(dev); | 1925 | struct orinoco_private *priv = netdev_priv(dev); |
1918 | struct hermes *hw = &priv->hw; | 1926 | struct hermes *hw = &priv->hw; |
1919 | int err = 0; | 1927 | int err; |
1920 | unsigned long flags; | 1928 | unsigned long flags; |
1921 | 1929 | ||
1922 | if (orinoco_lock(priv, &flags) != 0) | 1930 | if (orinoco_lock(priv, &flags) != 0) |
@@ -1938,20 +1946,20 @@ static void orinoco_reset(struct net_device *dev) | |||
1938 | 1946 | ||
1939 | orinoco_unlock(priv, &flags); | 1947 | orinoco_unlock(priv, &flags); |
1940 | 1948 | ||
1941 | if (priv->hard_reset) | 1949 | if (priv->hard_reset) { |
1942 | err = (*priv->hard_reset)(priv); | 1950 | err = (*priv->hard_reset)(priv); |
1943 | if (err) { | 1951 | if (err) { |
1944 | printk(KERN_ERR "%s: orinoco_reset: Error %d " | 1952 | printk(KERN_ERR "%s: orinoco_reset: Error %d " |
1945 | "performing hard reset\n", dev->name, err); | 1953 | "performing hard reset\n", dev->name, err); |
1946 | /* FIXME: shutdown of some sort */ | 1954 | goto disable; |
1947 | return; | 1955 | } |
1948 | } | 1956 | } |
1949 | 1957 | ||
1950 | err = orinoco_reinit_firmware(dev); | 1958 | err = orinoco_reinit_firmware(dev); |
1951 | if (err) { | 1959 | if (err) { |
1952 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", | 1960 | printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n", |
1953 | dev->name, err); | 1961 | dev->name, err); |
1954 | return; | 1962 | goto disable; |
1955 | } | 1963 | } |
1956 | 1964 | ||
1957 | spin_lock_irq(&priv->lock); /* This has to be called from user context */ | 1965 | spin_lock_irq(&priv->lock); /* This has to be called from user context */ |
@@ -1972,6 +1980,10 @@ static void orinoco_reset(struct net_device *dev) | |||
1972 | spin_unlock_irq(&priv->lock); | 1980 | spin_unlock_irq(&priv->lock); |
1973 | 1981 | ||
1974 | return; | 1982 | return; |
1983 | disable: | ||
1984 | hermes_set_irqmask(hw, 0); | ||
1985 | netif_device_detach(dev); | ||
1986 | printk(KERN_ERR "%s: Device has been disabled!\n", dev->name); | ||
1975 | } | 1987 | } |
1976 | 1988 | ||
1977 | /********************************************************************/ | 1989 | /********************************************************************/ |
@@ -2056,7 +2068,7 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
2056 | if (events & HERMES_EV_ALLOC) | 2068 | if (events & HERMES_EV_ALLOC) |
2057 | __orinoco_ev_alloc(dev, hw); | 2069 | __orinoco_ev_alloc(dev, hw); |
2058 | 2070 | ||
2059 | hermes_write_regn(hw, EVACK, events); | 2071 | hermes_write_regn(hw, EVACK, evstat); |
2060 | 2072 | ||
2061 | evstat = hermes_read_regn(hw, EVSTAT); | 2073 | evstat = hermes_read_regn(hw, EVSTAT); |
2062 | events = evstat & hw->inten; | 2074 | events = evstat & hw->inten; |
@@ -2215,6 +2227,8 @@ static int determine_firmware(struct net_device *dev) | |||
2215 | firmver >= 0x31000; | 2227 | firmver >= 0x31000; |
2216 | priv->has_preamble = (firmver >= 0x20000); | 2228 | priv->has_preamble = (firmver >= 0x20000); |
2217 | priv->ibss_port = 4; | 2229 | priv->ibss_port = 4; |
2230 | priv->broken_disableport = (firmver == 0x25013) || | ||
2231 | (firmver >= 0x30000 && firmver <= 0x31000); | ||
2218 | /* Tested with Intel firmware : 0x20015 => Jean II */ | 2232 | /* Tested with Intel firmware : 0x20015 => Jean II */ |
2219 | /* Tested with 3Com firmware : 0x15012 & 0x22001 => Jean II */ | 2233 | /* Tested with 3Com firmware : 0x15012 & 0x22001 => Jean II */ |
2220 | break; | 2234 | break; |
@@ -2267,7 +2281,7 @@ static int orinoco_init(struct net_device *dev) | |||
2267 | priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN; | 2281 | priv->nicbuf_size = IEEE802_11_FRAME_LEN + ETH_HLEN; |
2268 | 2282 | ||
2269 | /* Initialize the firmware */ | 2283 | /* Initialize the firmware */ |
2270 | err = hermes_init(hw); | 2284 | err = orinoco_reinit_firmware(dev); |
2271 | if (err != 0) { | 2285 | if (err != 0) { |
2272 | printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", | 2286 | printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", |
2273 | dev->name, err); | 2287 | dev->name, err); |
@@ -2400,31 +2414,12 @@ static int orinoco_init(struct net_device *dev) | |||
2400 | /* By default use IEEE/IBSS ad-hoc mode if we have it */ | 2414 | /* By default use IEEE/IBSS ad-hoc mode if we have it */ |
2401 | priv->prefer_port3 = priv->has_port3 && (! priv->has_ibss); | 2415 | priv->prefer_port3 = priv->has_port3 && (! priv->has_ibss); |
2402 | set_port_type(priv); | 2416 | set_port_type(priv); |
2403 | priv->channel = 10; /* default channel, more-or-less arbitrary */ | 2417 | priv->channel = 0; /* use firmware default */ |
2404 | 2418 | ||
2405 | priv->promiscuous = 0; | 2419 | priv->promiscuous = 0; |
2406 | priv->wep_on = 0; | 2420 | priv->wep_on = 0; |
2407 | priv->tx_key = 0; | 2421 | priv->tx_key = 0; |
2408 | 2422 | ||
2409 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | ||
2410 | if (err == -EIO) { | ||
2411 | /* Try workaround for old Symbol firmware bug */ | ||
2412 | printk(KERN_WARNING "%s: firmware ALLOC bug detected " | ||
2413 | "(old Symbol firmware?). Trying to work around... ", | ||
2414 | dev->name); | ||
2415 | |||
2416 | priv->nicbuf_size = TX_NICBUF_SIZE_BUG; | ||
2417 | err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid); | ||
2418 | if (err) | ||
2419 | printk("failed!\n"); | ||
2420 | else | ||
2421 | printk("ok.\n"); | ||
2422 | } | ||
2423 | if (err) { | ||
2424 | printk("%s: Error %d allocating Tx buffer\n", dev->name, err); | ||
2425 | goto out; | ||
2426 | } | ||
2427 | |||
2428 | /* Make the hardware available, as long as it hasn't been | 2423 | /* Make the hardware available, as long as it hasn't been |
2429 | * removed elsewhere (e.g. by PCMCIA hot unplug) */ | 2424 | * removed elsewhere (e.g. by PCMCIA hot unplug) */ |
2430 | spin_lock_irq(&priv->lock); | 2425 | spin_lock_irq(&priv->lock); |
@@ -2450,7 +2445,7 @@ struct net_device *alloc_orinocodev(int sizeof_card, | |||
2450 | priv = netdev_priv(dev); | 2445 | priv = netdev_priv(dev); |
2451 | priv->ndev = dev; | 2446 | priv->ndev = dev; |
2452 | if (sizeof_card) | 2447 | if (sizeof_card) |
2453 | priv->card = (void *)((unsigned long)netdev_priv(dev) | 2448 | priv->card = (void *)((unsigned long)priv |
2454 | + sizeof(struct orinoco_private)); | 2449 | + sizeof(struct orinoco_private)); |
2455 | else | 2450 | else |
2456 | priv->card = NULL; | 2451 | priv->card = NULL; |
@@ -2555,6 +2550,7 @@ static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active, | |||
2555 | } | 2550 | } |
2556 | 2551 | ||
2557 | len = le16_to_cpu(essidbuf.len); | 2552 | len = le16_to_cpu(essidbuf.len); |
2553 | BUG_ON(len > IW_ESSID_MAX_SIZE); | ||
2558 | 2554 | ||
2559 | memset(buf, 0, IW_ESSID_MAX_SIZE+1); | 2555 | memset(buf, 0, IW_ESSID_MAX_SIZE+1); |
2560 | memcpy(buf, p, len); | 2556 | memcpy(buf, p, len); |
@@ -2923,13 +2919,14 @@ static int orinoco_ioctl_setessid(struct net_device *dev, struct iw_point *erq) | |||
2923 | memset(&essidbuf, 0, sizeof(essidbuf)); | 2919 | memset(&essidbuf, 0, sizeof(essidbuf)); |
2924 | 2920 | ||
2925 | if (erq->flags) { | 2921 | if (erq->flags) { |
2926 | if (erq->length > IW_ESSID_MAX_SIZE) | 2922 | /* iwconfig includes the NUL in the specified length */ |
2923 | if (erq->length > IW_ESSID_MAX_SIZE+1) | ||
2927 | return -E2BIG; | 2924 | return -E2BIG; |
2928 | 2925 | ||
2929 | if (copy_from_user(&essidbuf, erq->pointer, erq->length)) | 2926 | if (copy_from_user(&essidbuf, erq->pointer, erq->length)) |
2930 | return -EFAULT; | 2927 | return -EFAULT; |
2931 | 2928 | ||
2932 | essidbuf[erq->length] = '\0'; | 2929 | essidbuf[IW_ESSID_MAX_SIZE] = '\0'; |
2933 | } | 2930 | } |
2934 | 2931 | ||
2935 | if (orinoco_lock(priv, &flags) != 0) | 2932 | if (orinoco_lock(priv, &flags) != 0) |
@@ -3855,7 +3852,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
3855 | { SIOCIWFIRSTPRIV + 0x7, 0, | 3852 | { SIOCIWFIRSTPRIV + 0x7, 0, |
3856 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, | 3853 | IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, |
3857 | "get_ibssport" }, | 3854 | "get_ibssport" }, |
3858 | { SIOCIWLASTPRIV, 0, 0, "dump_recs" }, | ||
3859 | }; | 3855 | }; |
3860 | 3856 | ||
3861 | wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]); | 3857 | wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]); |
@@ -3943,14 +3939,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
3943 | err = orinoco_ioctl_getibssport(dev, wrq); | 3939 | err = orinoco_ioctl_getibssport(dev, wrq); |
3944 | break; | 3940 | break; |
3945 | 3941 | ||
3946 | case SIOCIWLASTPRIV: | ||
3947 | err = orinoco_debug_dump_recs(dev); | ||
3948 | if (err) | ||
3949 | printk(KERN_ERR "%s: Unable to dump records (%d)\n", | ||
3950 | dev->name, err); | ||
3951 | break; | ||
3952 | |||
3953 | |||
3954 | default: | 3942 | default: |
3955 | err = -EOPNOTSUPP; | 3943 | err = -EOPNOTSUPP; |
3956 | } | 3944 | } |
@@ -3964,187 +3952,6 @@ orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
3964 | return err; | 3952 | return err; |
3965 | } | 3953 | } |
3966 | 3954 | ||
3967 | struct { | ||
3968 | u16 rid; | ||
3969 | char *name; | ||
3970 | int displaytype; | ||
3971 | #define DISPLAY_WORDS 0 | ||
3972 | #define DISPLAY_BYTES 1 | ||
3973 | #define DISPLAY_STRING 2 | ||
3974 | #define DISPLAY_XSTRING 3 | ||
3975 | } record_table[] = { | ||
3976 | #define DEBUG_REC(name,type) { HERMES_RID_##name, #name, DISPLAY_##type } | ||
3977 | DEBUG_REC(CNFPORTTYPE,WORDS), | ||
3978 | DEBUG_REC(CNFOWNMACADDR,BYTES), | ||
3979 | DEBUG_REC(CNFDESIREDSSID,STRING), | ||
3980 | DEBUG_REC(CNFOWNCHANNEL,WORDS), | ||
3981 | DEBUG_REC(CNFOWNSSID,STRING), | ||
3982 | DEBUG_REC(CNFOWNATIMWINDOW,WORDS), | ||
3983 | DEBUG_REC(CNFSYSTEMSCALE,WORDS), | ||
3984 | DEBUG_REC(CNFMAXDATALEN,WORDS), | ||
3985 | DEBUG_REC(CNFPMENABLED,WORDS), | ||
3986 | DEBUG_REC(CNFPMEPS,WORDS), | ||
3987 | DEBUG_REC(CNFMULTICASTRECEIVE,WORDS), | ||
3988 | DEBUG_REC(CNFMAXSLEEPDURATION,WORDS), | ||
3989 | DEBUG_REC(CNFPMHOLDOVERDURATION,WORDS), | ||
3990 | DEBUG_REC(CNFOWNNAME,STRING), | ||
3991 | DEBUG_REC(CNFOWNDTIMPERIOD,WORDS), | ||
3992 | DEBUG_REC(CNFMULTICASTPMBUFFERING,WORDS), | ||
3993 | DEBUG_REC(CNFWEPENABLED_AGERE,WORDS), | ||
3994 | DEBUG_REC(CNFMANDATORYBSSID_SYMBOL,WORDS), | ||
3995 | DEBUG_REC(CNFWEPDEFAULTKEYID,WORDS), | ||
3996 | DEBUG_REC(CNFDEFAULTKEY0,BYTES), | ||
3997 | DEBUG_REC(CNFDEFAULTKEY1,BYTES), | ||
3998 | DEBUG_REC(CNFMWOROBUST_AGERE,WORDS), | ||
3999 | DEBUG_REC(CNFDEFAULTKEY2,BYTES), | ||
4000 | DEBUG_REC(CNFDEFAULTKEY3,BYTES), | ||
4001 | DEBUG_REC(CNFWEPFLAGS_INTERSIL,WORDS), | ||
4002 | DEBUG_REC(CNFWEPKEYMAPPINGTABLE,WORDS), | ||
4003 | DEBUG_REC(CNFAUTHENTICATION,WORDS), | ||
4004 | DEBUG_REC(CNFMAXASSOCSTA,WORDS), | ||
4005 | DEBUG_REC(CNFKEYLENGTH_SYMBOL,WORDS), | ||
4006 | DEBUG_REC(CNFTXCONTROL,WORDS), | ||
4007 | DEBUG_REC(CNFROAMINGMODE,WORDS), | ||
4008 | DEBUG_REC(CNFHOSTAUTHENTICATION,WORDS), | ||
4009 | DEBUG_REC(CNFRCVCRCERROR,WORDS), | ||
4010 | DEBUG_REC(CNFMMLIFE,WORDS), | ||
4011 | DEBUG_REC(CNFALTRETRYCOUNT,WORDS), | ||
4012 | DEBUG_REC(CNFBEACONINT,WORDS), | ||
4013 | DEBUG_REC(CNFAPPCFINFO,WORDS), | ||
4014 | DEBUG_REC(CNFSTAPCFINFO,WORDS), | ||
4015 | DEBUG_REC(CNFPRIORITYQUSAGE,WORDS), | ||
4016 | DEBUG_REC(CNFTIMCTRL,WORDS), | ||
4017 | DEBUG_REC(CNFTHIRTY2TALLY,WORDS), | ||
4018 | DEBUG_REC(CNFENHSECURITY,WORDS), | ||
4019 | DEBUG_REC(CNFGROUPADDRESSES,BYTES), | ||
4020 | DEBUG_REC(CNFCREATEIBSS,WORDS), | ||
4021 | DEBUG_REC(CNFFRAGMENTATIONTHRESHOLD,WORDS), | ||
4022 | DEBUG_REC(CNFRTSTHRESHOLD,WORDS), | ||
4023 | DEBUG_REC(CNFTXRATECONTROL,WORDS), | ||
4024 | DEBUG_REC(CNFPROMISCUOUSMODE,WORDS), | ||
4025 | DEBUG_REC(CNFBASICRATES_SYMBOL,WORDS), | ||
4026 | DEBUG_REC(CNFPREAMBLE_SYMBOL,WORDS), | ||
4027 | DEBUG_REC(CNFSHORTPREAMBLE,WORDS), | ||
4028 | DEBUG_REC(CNFWEPKEYS_AGERE,BYTES), | ||
4029 | DEBUG_REC(CNFEXCLUDELONGPREAMBLE,WORDS), | ||
4030 | DEBUG_REC(CNFTXKEY_AGERE,WORDS), | ||
4031 | DEBUG_REC(CNFAUTHENTICATIONRSPTO,WORDS), | ||
4032 | DEBUG_REC(CNFBASICRATES,WORDS), | ||
4033 | DEBUG_REC(CNFSUPPORTEDRATES,WORDS), | ||
4034 | DEBUG_REC(CNFTICKTIME,WORDS), | ||
4035 | DEBUG_REC(CNFSCANREQUEST,WORDS), | ||
4036 | DEBUG_REC(CNFJOINREQUEST,WORDS), | ||
4037 | DEBUG_REC(CNFAUTHENTICATESTATION,WORDS), | ||
4038 | DEBUG_REC(CNFCHANNELINFOREQUEST,WORDS), | ||
4039 | DEBUG_REC(MAXLOADTIME,WORDS), | ||
4040 | DEBUG_REC(DOWNLOADBUFFER,WORDS), | ||
4041 | DEBUG_REC(PRIID,WORDS), | ||
4042 | DEBUG_REC(PRISUPRANGE,WORDS), | ||
4043 | DEBUG_REC(CFIACTRANGES,WORDS), | ||
4044 | DEBUG_REC(NICSERNUM,XSTRING), | ||
4045 | DEBUG_REC(NICID,WORDS), | ||
4046 | DEBUG_REC(MFISUPRANGE,WORDS), | ||
4047 | DEBUG_REC(CFISUPRANGE,WORDS), | ||
4048 | DEBUG_REC(CHANNELLIST,WORDS), | ||
4049 | DEBUG_REC(REGULATORYDOMAINS,WORDS), | ||
4050 | DEBUG_REC(TEMPTYPE,WORDS), | ||
4051 | /* DEBUG_REC(CIS,BYTES), */ | ||
4052 | DEBUG_REC(STAID,WORDS), | ||
4053 | DEBUG_REC(CURRENTSSID,STRING), | ||
4054 | DEBUG_REC(CURRENTBSSID,BYTES), | ||
4055 | DEBUG_REC(COMMSQUALITY,WORDS), | ||
4056 | DEBUG_REC(CURRENTTXRATE,WORDS), | ||
4057 | DEBUG_REC(CURRENTBEACONINTERVAL,WORDS), | ||
4058 | DEBUG_REC(CURRENTSCALETHRESHOLDS,WORDS), | ||
4059 | DEBUG_REC(PROTOCOLRSPTIME,WORDS), | ||
4060 | DEBUG_REC(SHORTRETRYLIMIT,WORDS), | ||
4061 | DEBUG_REC(LONGRETRYLIMIT,WORDS), | ||
4062 | DEBUG_REC(MAXTRANSMITLIFETIME,WORDS), | ||
4063 | DEBUG_REC(MAXRECEIVELIFETIME,WORDS), | ||
4064 | DEBUG_REC(CFPOLLABLE,WORDS), | ||
4065 | DEBUG_REC(AUTHENTICATIONALGORITHMS,WORDS), | ||
4066 | DEBUG_REC(PRIVACYOPTIONIMPLEMENTED,WORDS), | ||
4067 | DEBUG_REC(OWNMACADDR,BYTES), | ||
4068 | DEBUG_REC(SCANRESULTSTABLE,WORDS), | ||
4069 | DEBUG_REC(PHYTYPE,WORDS), | ||
4070 | DEBUG_REC(CURRENTCHANNEL,WORDS), | ||
4071 | DEBUG_REC(CURRENTPOWERSTATE,WORDS), | ||
4072 | DEBUG_REC(CCAMODE,WORDS), | ||
4073 | DEBUG_REC(SUPPORTEDDATARATES,WORDS), | ||
4074 | DEBUG_REC(BUILDSEQ,BYTES), | ||
4075 | DEBUG_REC(FWID,XSTRING) | ||
4076 | #undef DEBUG_REC | ||
4077 | }; | ||
4078 | |||
4079 | #define DEBUG_LTV_SIZE 128 | ||
4080 | |||
4081 | static int orinoco_debug_dump_recs(struct net_device *dev) | ||
4082 | { | ||
4083 | struct orinoco_private *priv = netdev_priv(dev); | ||
4084 | hermes_t *hw = &priv->hw; | ||
4085 | u8 *val8; | ||
4086 | u16 *val16; | ||
4087 | int i,j; | ||
4088 | u16 length; | ||
4089 | int err; | ||
4090 | |||
4091 | /* I'm not sure: we might have a lock here, so we'd better go | ||
4092 | atomic, just in case. */ | ||
4093 | val8 = kmalloc(DEBUG_LTV_SIZE + 2, GFP_ATOMIC); | ||
4094 | if (! val8) | ||
4095 | return -ENOMEM; | ||
4096 | val16 = (u16 *)val8; | ||
4097 | |||
4098 | for (i = 0; i < ARRAY_SIZE(record_table); i++) { | ||
4099 | u16 rid = record_table[i].rid; | ||
4100 | int len; | ||
4101 | |||
4102 | memset(val8, 0, DEBUG_LTV_SIZE + 2); | ||
4103 | |||
4104 | err = hermes_read_ltv(hw, USER_BAP, rid, DEBUG_LTV_SIZE, | ||
4105 | &length, val8); | ||
4106 | if (err) { | ||
4107 | DEBUG(0, "Error %d reading RID 0x%04x\n", err, rid); | ||
4108 | continue; | ||
4109 | } | ||
4110 | val16 = (u16 *)val8; | ||
4111 | if (length == 0) | ||
4112 | continue; | ||
4113 | |||
4114 | printk(KERN_DEBUG "%-15s (0x%04x): length=%d (%d bytes)\tvalue=", | ||
4115 | record_table[i].name, | ||
4116 | rid, length, (length-1)*2); | ||
4117 | len = min(((int)length-1)*2, DEBUG_LTV_SIZE); | ||
4118 | |||
4119 | switch (record_table[i].displaytype) { | ||
4120 | case DISPLAY_WORDS: | ||
4121 | for (j = 0; j < len / 2; j++) | ||
4122 | printk("%04X-", le16_to_cpu(val16[j])); | ||
4123 | break; | ||
4124 | |||
4125 | case DISPLAY_BYTES: | ||
4126 | default: | ||
4127 | for (j = 0; j < len; j++) | ||
4128 | printk("%02X:", val8[j]); | ||
4129 | break; | ||
4130 | |||
4131 | case DISPLAY_STRING: | ||
4132 | len = min(len, le16_to_cpu(val16[0])+2); | ||
4133 | val8[len] = '\0'; | ||
4134 | printk("\"%s\"", (char *)&val16[1]); | ||
4135 | break; | ||
4136 | |||
4137 | case DISPLAY_XSTRING: | ||
4138 | printk("'%s'", (char *)val8); | ||
4139 | } | ||
4140 | |||
4141 | printk("\n"); | ||
4142 | } | ||
4143 | |||
4144 | kfree(val8); | ||
4145 | |||
4146 | return 0; | ||
4147 | } | ||
4148 | 3955 | ||
4149 | /********************************************************************/ | 3956 | /********************************************************************/ |
4150 | /* Debugging */ | 3957 | /* Debugging */ |
@@ -4218,7 +4025,6 @@ EXPORT_SYMBOL(free_orinocodev); | |||
4218 | 4025 | ||
4219 | EXPORT_SYMBOL(__orinoco_up); | 4026 | EXPORT_SYMBOL(__orinoco_up); |
4220 | EXPORT_SYMBOL(__orinoco_down); | 4027 | EXPORT_SYMBOL(__orinoco_down); |
4221 | EXPORT_SYMBOL(orinoco_stop); | ||
4222 | EXPORT_SYMBOL(orinoco_reinit_firmware); | 4028 | EXPORT_SYMBOL(orinoco_reinit_firmware); |
4223 | 4029 | ||
4224 | EXPORT_SYMBOL(orinoco_interrupt); | 4030 | EXPORT_SYMBOL(orinoco_interrupt); |
diff --git a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h index 13e42c2afb27..f749b50d1088 100644 --- a/drivers/net/wireless/orinoco.h +++ b/drivers/net/wireless/orinoco.h | |||
@@ -119,7 +119,6 @@ extern struct net_device *alloc_orinocodev(int sizeof_card, | |||
119 | extern void free_orinocodev(struct net_device *dev); | 119 | extern void free_orinocodev(struct net_device *dev); |
120 | extern int __orinoco_up(struct net_device *dev); | 120 | extern int __orinoco_up(struct net_device *dev); |
121 | extern int __orinoco_down(struct net_device *dev); | 121 | extern int __orinoco_down(struct net_device *dev); |
122 | extern int orinoco_stop(struct net_device *dev); | ||
123 | extern int orinoco_reinit_firmware(struct net_device *dev); | 122 | extern int orinoco_reinit_firmware(struct net_device *dev); |
124 | extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs); | 123 | extern irqreturn_t orinoco_interrupt(int irq, void * dev_id, struct pt_regs *regs); |
125 | 124 | ||