/[orinoco]/orinoco/orinoco.c
ViewVC logotype

Diff of /orinoco/orinoco.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by dgibson, Fri Sep 12 04:19:04 2003 UTC revision 1.5 by dgibson, Mon Sep 29 05:23:30 2003 UTC
# Line 3  Line 3 
3   * A driver for Hermes or Prism 2 chipset based PCMCIA wireless   * A driver for Hermes or Prism 2 chipset based PCMCIA wireless
4   * adaptors, with Lucent/Agere, Intersil or Symbol firmware.   * adaptors, with Lucent/Agere, Intersil or Symbol firmware.
5   *   *
6     * Current maintainers (as of 29 September 2003) are:
7     *      David Gibson <hermes AT gibson.dropbear.id.au>
8     * and  Pavel Roskin <proski AT gnu.org>
9     *
10   * (C) Copyright David Gibson, IBM Corporation 2001-2003.   * (C) Copyright David Gibson, IBM Corporation 2001-2003.
11   * Copyright (C) 2000 David Gibson, Linuxcare Australia <hermes@gibson.dropbear.id.au>   * Copyright (C) 2000 David Gibson, Linuxcare Australia.
12   *      With some help from :   *      With some help from :
13   * Copyright (C) 2001 Jean Tourrilhes, HP Labs <jt@hpl.hp.com>   * Copyright (C) 2001 Jean Tourrilhes, HP Labs <jt AT hpl.hp.com>
14   * Copyright (C) 2001 Benjamin Herrenschmidt <benh@kernel.crashing.org>   * Copyright (C) 2001 Benjamin Herrenschmidt <benh AT kernel.crashing.org>
15   *   *
16   * Based on dummy_cs.c 1.27 2000/06/12 21:27:25   * Based on dummy_cs.c 1.27 2000/06/12 21:27:25
17   *   *
18   * Portions based on wvlan_cs.c 1.0.6, Copyright Andreas Neuhaus <andy@fasta.fh-dortmund.de>   * Portions based on wvlan_cs.c 1.0.6, Copyright Andreas Neuhaus <andy
19     * AT fasta.fh-dortmund.de>
20   *      http://www.stud.fh-dortmund.de/~andy/wvlan/   *      http://www.stud.fh-dortmund.de/~andy/wvlan/
21   *   *
22   * The contents of this file are subject to the Mozilla Public License   * The contents of this file are subject to the Mozilla Public License
# Line 25  Line 30 
30   * limitations under the License.   * limitations under the License.
31   *   *
32   * The initial developer of the original code is David A. Hinds   * The initial developer of the original code is David A. Hinds
33   * <dahinds@users.sourceforge.net>.  Portions created by David   * <dahinds AT users.sourceforge.net>.  Portions created by David
34   * A. Hinds are Copyright (C) 1999 David A. Hinds.  All Rights   * A. Hinds are Copyright (C) 1999 David A. Hinds.  All Rights
35   * Reserved.   * Reserved.
36   *   *
# Line 83  Line 88 
88   *      o Clean up RID definitions in hermes.h, other cleanups   *      o Clean up RID definitions in hermes.h, other cleanups
89   *   *
90   * v0.04b -> v0.04c - 24/4/2001 - Jean II   * v0.04b -> v0.04c - 24/4/2001 - Jean II
91   *      o Tim Hurley <timster@seiki.bliztech.com> reported a D-Link card   *      o Tim Hurley <timster AT seiki.bliztech.com> reported a D-Link card
92   *        with vendor 02 and firmware 0.08. Added in the capabilities...   *        with vendor 02 and firmware 0.08. Added in the capabilities...
93   *      o Tested Lucent firmware 7.28, everything works...   *      o Tested Lucent firmware 7.28, everything works...
94   *   *
# Line 107  Line 112 
112   *   *
113   * v0.05c -> v0.05d - 5/5/2001 - Jean II   * v0.05c -> v0.05d - 5/5/2001 - Jean II
114   *      o Workaround to SNAP decapsulate frame from LinkSys AP   *      o Workaround to SNAP decapsulate frame from LinkSys AP
115   *        original patch from : Dong Liu <dliu@research.bell-labs.com>   *        original patch from : Dong Liu <dliu AT research.bell-labs.com>
116   *        (note : the memcmp bug was mine - fixed)   *        (note : the memcmp bug was mine - fixed)
117   *      o Remove set_retry stuff, no firmware support it (bloat--).   *      o Remove set_retry stuff, no firmware support it (bloat--).
118   *   *
119   * v0.05d -> v0.06 - 25/5/2001 - Jean II   * v0.05d -> v0.06 - 25/5/2001 - Jean II
120   *              Original patch from "Hong Lin" <alin@redhat.com>,   *              Original patch from "Hong Lin" <alin AT redhat.com>,
121   *              "Ian Kinner" <ikinner@redhat.com>   *              "Ian Kinner" <ikinner AT redhat.com>
122   *              and "David Smith" <dsmith@redhat.com>   *              and "David Smith" <dsmith AT redhat.com>
123   *      o Init of priv->tx_rate_ctrl in firmware specific section.   *      o Init of priv->tx_rate_ctrl in firmware specific section.
124   *      o Prism2/Symbol rate, upto should be 0xF and not 0x15. Doh !   *      o Prism2/Symbol rate, upto should be 0xF and not 0x15. Doh !
125   *      o Spectrum card always need cor_reset (for every reset)   *      o Spectrum card always need cor_reset (for every reset)
# Line 138  Line 143 
143   *        wishes to reduce the number of unecessary messages.   *        wishes to reduce the number of unecessary messages.
144   *      o Removed bogus message on CRC error.   *      o Removed bogus message on CRC error.
145   *      o Merged fixeds for v0.08 Prism 2 firmware from William Waghorn   *      o Merged fixeds for v0.08 Prism 2 firmware from William Waghorn
146   *        <willwaghorn@yahoo.co.uk>   *        <willwaghorn AT yahoo.co.uk>
147   *      o Slight cleanup/re-arrangement of firmware detection code.   *      o Slight cleanup/re-arrangement of firmware detection code.
148   *   *
149   * v0.06d -> v0.06e - 1/8/2001 - David Gibson   * v0.06d -> v0.06e - 1/8/2001 - David Gibson
# Line 160  Line 165 
165   * v0.07 -> v0.07a - 1/10/3001 - Jean II   * v0.07 -> v0.07a - 1/10/3001 - Jean II
166   *      o Add code to read Symbol firmware revision, inspired by latest code   *      o Add code to read Symbol firmware revision, inspired by latest code
167   *        in Spectrum24 by Lee John Keyser-Allen - Thanks Lee !   *        in Spectrum24 by Lee John Keyser-Allen - Thanks Lee !
168   *      o Thanks to Jared Valentine <hidden@xmission.com> for "providing" me   *      o Thanks to Jared Valentine <hidden AT xmission.com> for "providing" me
169   *        a 3Com card with a recent firmware, fill out Symbol firmware   *        a 3Com card with a recent firmware, fill out Symbol firmware
170   *        capabilities of latest rev (2.20), as well as older Symbol cards.   *        capabilities of latest rev (2.20), as well as older Symbol cards.
171   *      o Disable Power Management in newer Symbol firmware, the API   *      o Disable Power Management in newer Symbol firmware, the API
# Line 395  Line 400 
400   *        the ESSID is empty.  Too many firmwares break if we do.   *        the ESSID is empty.  Too many firmwares break if we do.
401   *      o 2.6 merges: Replace pdev->slot_name with pci_name(), remove   *      o 2.6 merges: Replace pdev->slot_name with pci_name(), remove
402   *        __devinitdata from PCI ID tables, use free_netdev().   *        __devinitdata from PCI ID tables, use free_netdev().
403     *      o Enabed shared-key authentication for Agere firmware (from
404     *        Robert J. Moore <Robert.J.Moore AT allanbank.com>
405     *      o Move netif_wake_queue() (back) to the Tx completion from the
406     *        ALLOC event.  This seems to prevent/mitigate the rolling
407     *        error -110 problems at least on some Intersil firmwares.
408     *        Theoretically reduces performance, but I can't measure it.
409     *        Patch from Andrew Tridgell <tridge AT samba.org>
410   *   *
411   * TODO   * TODO
412   *      o New wireless extensions API (patch from Moustafa   *      o New wireless extensions API (patch from Moustafa
# Line 519  const long channel_frequency[] = { Line 531  const long channel_frequency[] = {
531          2412, 2417, 2422, 2427, 2432, 2437, 2442,          2412, 2417, 2422, 2427, 2432, 2437, 2442,
532          2447, 2452, 2457, 2462, 2467, 2472, 2484          2447, 2452, 2457, 2462, 2467, 2472, 2484
533  };  };
534  #define NUM_CHANNELS ( sizeof(channel_frequency) / sizeof(channel_frequency[0]) )  #define NUM_CHANNELS ARRAY_SIZE(channel_frequency)
535    
536  /* This tables gives the actual meanings of the bitrate IDs returned by the firmware. */  /* This tables gives the actual meanings of the bitrate IDs returned by the firmware. */
537  struct {  struct {
# Line 537  struct { Line 549  struct {
549          {55,  1,  7,  7},          {55,  1,  7,  7},
550          {110, 0,  5,  8},          {110, 0,  5,  8},
551  };  };
552  #define BITRATE_TABLE_SIZE (sizeof(bitrate_table) / sizeof(bitrate_table[0]))  #define BITRATE_TABLE_SIZE ARRAY_SIZE(bitrate_table)
553    
554  /********************************************************************/  /********************************************************************/
555  /* Function prototypes                                              */  /* Function prototypes                                              */
# Line 1118  static int __orinoco_hw_setup_wep(struct Line 1130  static int __orinoco_hw_setup_wep(struct
1130          switch (priv->firmware_type) {          switch (priv->firmware_type) {
1131          case FIRMWARE_TYPE_AGERE: /* Agere style WEP */          case FIRMWARE_TYPE_AGERE: /* Agere style WEP */
1132                  if (priv->wep_on) {                  if (priv->wep_on) {
1133                            /* Enable the shared-key authentication. */
1134                            /* FIXME: We never clear the authentication flag... */
1135                            if (priv->wep_restrict) {
1136                                    auth_flag = 0x2;
1137                                    err = hermes_write_wordrec(hw, USER_BAP,
1138                                                               HERMES_RID_CNFAUTHENTICATION_AGERE,
1139                                                               auth_flag);          
1140                                    if (err)
1141                                            return err;
1142                            }                        
1143                          err = hermes_write_wordrec(hw, USER_BAP,                          err = hermes_write_wordrec(hw, USER_BAP,
1144                                                     HERMES_RID_CNFTXKEY_AGERE,                                                     HERMES_RID_CNFTXKEY_AGERE,
1145                                                     priv->tx_key);                                                     priv->tx_key);
# Line 1484  irqreturn_t orinoco_interrupt(int irq, v Line 1506  irqreturn_t orinoco_interrupt(int irq, v
1506                  if (events & HERMES_EV_ALLOC)                  if (events & HERMES_EV_ALLOC)
1507                          __orinoco_ev_alloc(dev, hw);                          __orinoco_ev_alloc(dev, hw);
1508                                    
1509                  hermes_write_regn(hw, EVACK, events);                  hermes_write_regn(hw, EVACK, evstat);
1510    
1511                  evstat = hermes_read_regn(hw, EVSTAT);                  evstat = hermes_read_regn(hw, EVSTAT);
1512                  events = evstat & hw->inten;                  events = evstat & hw->inten;
# Line 1835  static void __orinoco_ev_tx(struct net_d Line 1857  static void __orinoco_ev_tx(struct net_d
1857    
1858          stats->tx_packets++;          stats->tx_packets++;
1859    
1860            if (fid != priv->txfid) {
1861                    if (fid != DUMMY_FID)
1862                            printk(KERN_WARNING "%s: Tx event on unexpected fid (%04X)\n",
1863                                   dev->name, fid);
1864                    return;
1865            }
1866    
1867            netif_wake_queue(dev);
1868    
1869          hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);          hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
1870  }  }
1871    
1872  static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw)  static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw)
1873  {  {
1874          struct orinoco_private *priv = dev->priv;          struct orinoco_private *priv = dev->priv;
   
1875          u16 fid = hermes_read_regn(hw, ALLOCFID);          u16 fid = hermes_read_regn(hw, ALLOCFID);
1876    
1877          if (fid != priv->txfid) {          if (fid != priv->txfid) {
# Line 1849  static void __orinoco_ev_alloc(struct ne Line 1879  static void __orinoco_ev_alloc(struct ne
1879                          printk(KERN_WARNING "%s: Allocate event on unexpected fid (%04X)\n",                          printk(KERN_WARNING "%s: Allocate event on unexpected fid (%04X)\n",
1880                                 dev->name, fid);                                 dev->name, fid);
1881                  return;                  return;
         } else {  
                 netif_wake_queue(dev);  
1882          }          }
1883    
1884          hermes_write_regn(hw, ALLOCFID, DUMMY_FID);          hermes_write_regn(hw, ALLOCFID, DUMMY_FID);
# Line 2758  static int orinoco_ioctl_setiwencode(str Line 2786  static int orinoco_ioctl_setiwencode(str
2786                    
2787          if (erq->flags & IW_ENCODE_DISABLED)          if (erq->flags & IW_ENCODE_DISABLED)
2788                  enable = 0;                  enable = 0;
         /* Only for Prism2 & Symbol cards (so far) - Jean II */  
2789          if (erq->flags & IW_ENCODE_OPEN)          if (erq->flags & IW_ENCODE_OPEN)
2790                  restricted = 0;                  restricted = 0;
2791          if (erq->flags & IW_ENCODE_RESTRICTED)          if (erq->flags & IW_ENCODE_RESTRICTED)
# Line 2772  static int orinoco_ioctl_setiwencode(str Line 2799  static int orinoco_ioctl_setiwencode(str
2799          priv->tx_key = setindex;          priv->tx_key = setindex;
2800          priv->wep_on = enable;          priv->wep_on = enable;
2801          priv->wep_restrict = restricted;          priv->wep_restrict = restricted;
   
2802                    
2803   out:   out:
2804          orinoco_unlock(priv, &flags);          orinoco_unlock(priv, &flags);
# Line 2801  static int orinoco_ioctl_getiwencode(str Line 2827  static int orinoco_ioctl_getiwencode(str
2827                  erq->flags |= IW_ENCODE_DISABLED;                  erq->flags |= IW_ENCODE_DISABLED;
2828          erq->flags |= index + 1;          erq->flags |= index + 1;
2829                    
2830          /* Only for symbol cards - Jean II */          if (priv->wep_restrict)
2831          if (priv->firmware_type != FIRMWARE_TYPE_AGERE) {                  erq->flags |= IW_ENCODE_RESTRICTED;
2832                  if(priv->wep_restrict)          else
2833                          erq->flags |= IW_ENCODE_RESTRICTED;                  erq->flags |= IW_ENCODE_OPEN;
                 else  
                         erq->flags |= IW_ENCODE_OPEN;  
         }  
2834    
2835          xlen = le16_to_cpu(priv->keys[index].len);          xlen = le16_to_cpu(priv->keys[index].len);
2836    
# Line 3960  struct { Line 3983  struct {
3983          DEBUG_REC(CNFOWNDTIMPERIOD,WORDS),          DEBUG_REC(CNFOWNDTIMPERIOD,WORDS),
3984          DEBUG_REC(CNFMULTICASTPMBUFFERING,WORDS),          DEBUG_REC(CNFMULTICASTPMBUFFERING,WORDS),
3985          DEBUG_REC(CNFWEPENABLED_AGERE,WORDS),          DEBUG_REC(CNFWEPENABLED_AGERE,WORDS),
3986            DEBUG_REC(CNFAUTHENTICATION_AGERE,WORDS),
3987          DEBUG_REC(CNFMANDATORYBSSID_SYMBOL,WORDS),          DEBUG_REC(CNFMANDATORYBSSID_SYMBOL,WORDS),
3988          DEBUG_REC(CNFWEPDEFAULTKEYID,WORDS),          DEBUG_REC(CNFWEPDEFAULTKEYID,WORDS),
3989          DEBUG_REC(CNFDEFAULTKEY0,BYTES),          DEBUG_REC(CNFDEFAULTKEY0,BYTES),
# Line 4176  EXPORT_SYMBOL(__orinoco_ev_info); Line 4200  EXPORT_SYMBOL(__orinoco_ev_info);
4200    
4201  /* Can't be declared "const" or the whole __initdata section will  /* Can't be declared "const" or the whole __initdata section will
4202   * become const */   * become const */
4203  static char version[] __initdata = "orinoco.c 0.14beta1HEAD (David Gibson <hermes@gibson.dropbear.id.au> and others)";  static char version[] __initdata = "orinoco.c 0.14beta1 (David Gibson <hermes@gibson.dropbear.id.au>, Pavel Roskin <proski@gnu.org>, et al)";
4204    
4205  static int __init init_orinoco(void)  static int __init init_orinoco(void)
4206  {  {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26