Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r4005 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   2. r4006 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   3. r4007 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-02-01 02:07:28 +0100 (Fri, 01 Feb 2008)
New Revision: 4005

Modified:
   branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch
Log:
[PATCH 1/3] ar6k: WPA wireless extensions implementation

Implement the needed WPA wireless extensions calls.
Now we can use the wext wpa_supplicant driver, and don't need to carry
the wpa_supplicant atheros patch anymore.

Note that this patch also includes some generic ioctl cleanups.

Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>



Modified: branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch      
2008-02-01 00:50:14 UTC (rev 4004)
+++ branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch      
2008-02-01 01:07:28 UTC (rev 4005)
@@ -79,7 +79,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
-@@ -0,0 +1,3075 @@
+@@ -0,0 +1,3062 @@
 +/*
 + *
 + * Copyright (c) 2004-2007 Atheros Communications Inc.
@@ -341,14 +341,6 @@
 +   AR6002_HOST_INTEREST_ITEM_ADDRESS(item))
 +
 +
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-+/* Looks like we need this for 2.4 kernels */
-+static inline void *netdev_priv(struct net_device *dev)
-+{
-+    return(dev->priv);
-+}
-+#endif
-+
 +/* Debug log support */
 +
 +/*
@@ -905,16 +897,11 @@
 +    dev->get_stats = &ar6000_get_stats;
 +
 +    /* dev->tx_timeout = ar6000_tx_timeout; */
-+    dev->do_ioctl = &ar6000_ioctl_dispatcher;
++    dev->do_ioctl = &ar6000_ioctl;
 +    dev->watchdog_timeo = AR6000_TX_TIMEOUT;
 +    ar6000_ioctl_iwsetup(&ath_iw_handler_def);
 +    dev->wireless_handlers = &ath_iw_handler_def;
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
-+    dev->get_wireless_stats = ar6000_get_iwstats; /*Displayed via proc fs */
-+#else
 +    ath_iw_handler_def.get_wireless_stats = ar6000_get_iwstats; /*Displayed 
via proc fs */
-+#endif
 +
 +    /*
 +     * We need the OS to provide us with more headroom in order to
@@ -3159,7 +3146,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
-@@ -0,0 +1,362 @@
+@@ -0,0 +1,360 @@
 +/*
 + *
 + * Copyright (c) 2004-2007 Atheros Communications Inc.
@@ -3234,8 +3221,6 @@
 +#define  __dev_put(dev) dev_put(dev)
 +#endif
 +
-+#define  __ATH_CENTRAL_IOCTL_DISPATCHER___  /* To become compile time flag */
-+
 +#ifdef USER_KEYS
 +
 +#define USER_SAVEDKEYS_STAT_INIT     0
@@ -5293,7 +5278,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/function/wlan/ar6000/ar6000/ioctl.c
-@@ -0,0 +1,2573 @@
+@@ -0,0 +1,2540 @@
 +/*
 + *
 + * Copyright (c) 2004-2007 Atheros Communications Inc.
@@ -5323,10 +5308,6 @@
 +extern int tspecCompliance;
 +extern int bmienable;
 +extern int bypasswmi;
-+#ifdef __ATH_CENTRAL_IOCTL_DISPATCHER___
-+extern int allow_trace_signal;
-+extern void ath_external_trigger(int val);
-+#endif
 +
 +static int
 +ar6000_ioctl_get_roam_tbl(struct net_device *dev, struct ifreq *rq)
@@ -6259,35 +6240,6 @@
 +}
 +#endif /* CONFIG_HOST_GPIO_SUPPORT */
 +
-+/* This would basically hold all the private ioctls that are not related to
-+   WLAN operation */
-+#ifdef __ATH_CENTRAL_IOCTL_DISPATCHER___
-+int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd)
-+{
-+    int ret;
-+
-+    /* We need to find out what IOCTL is this.
-+     * This is non-prive IOCTL, which is called by
-+     * kernel, every second. This will mess up and confuse
-+     * the scope instrumentation(for time calculation)
-+     */
-+    if(cmd == 35142)
-+        return -EOPNOTSUPP;
-+
-+    ath_external_trigger(1);
-+    ret = ar6000_ioctl(dev, rq,cmd);
-+    /* Some calls are way too fast. Add a fixed delay
-+     * to all by 5ms. This will be clear on scope
-+     */
-+    if (allow_trace_signal) {
-+        /* Add some (fixed) delay for scope viewing */
-+        mdelay(5);
-+    }
-+    ath_external_trigger(0);
-+    return ret;
-+}
-+#endif /* __ATH_CENTRAL_IOCTL_DISPATCHER___ */
-+
 +int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
@@ -7548,29 +7500,29 @@
 +            A_UINT8           appIeInfo[IEEE80211_APPIE_FRAME_MAX_LEN];
 +            A_UINT32            fType,ieLen;
 +
-+                      if (ar->arWmiReady == FALSE) {
-+                              return -EIO;
-+                      }
-+                      get_user(fType, (A_UINT32 *)userdata);
-+                      appIEcmd.mgmtFrmType = fType;
-+                      if (appIEcmd.mgmtFrmType >= 
IEEE80211_APPIE_NUM_OF_FRAME) {
-+                              ret = -EIO;
-+                      } else {
-+                              get_user(ieLen, (A_UINT32 *)(userdata + 4));
-+                              appIEcmd.ieLen = ieLen;
-+                              if (appIEcmd.ieLen > 
IEEE80211_APPIE_FRAME_MAX_LEN) {
-+                                      ret = -EIO;
-+                                      break;
-+                              }
-+                              if (copy_from_user(appIeInfo, userdata + 8, 
appIEcmd.ieLen)) {
-+                                      ret = -EFAULT;
-+                              } else {
-+                                      if (wmi_set_appie_cmd(ar->arWmi, 
appIEcmd.mgmtFrmType,
-+                                                                              
  appIEcmd.ieLen,  appIeInfo) != A_OK)
-+                                      {
-+                                              ret = -EIO;
-+                                      }
-+                              }
++          if (ar->arWmiReady == FALSE) {
++                  return -EIO;
++          }
++          get_user(fType, (A_UINT32 *)userdata);
++          appIEcmd.mgmtFrmType = fType;
++          if (appIEcmd.mgmtFrmType >= IEEE80211_APPIE_NUM_OF_FRAME) {
++                  ret = -EIO;
++          } else {
++                  get_user(ieLen, (A_UINT32 *)(userdata + 4));
++                  appIEcmd.ieLen = ieLen;
++                  if (appIEcmd.ieLen > IEEE80211_APPIE_FRAME_MAX_LEN) {
++                          ret = -EIO;
++                          break;
++                  }
++                  if (copy_from_user(appIeInfo, userdata + 8, 
appIEcmd.ieLen)) {
++                          ret = -EFAULT;
++                  } else {
++                          if (wmi_set_appie_cmd(ar->arWmi, 
appIEcmd.mgmtFrmType,
++                                                appIEcmd.ieLen,  appIeInfo) 
!= A_OK)
++                          {
++                                  ret = -EIO;
++                          }
++                  }
 +            }
 +            break;
 +        }
@@ -8425,7 +8377,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
-@@ -0,0 +1,2072 @@
+@@ -0,0 +1,1914 @@
 +/*
 + *
 + * Copyright (c) 2004-2007 Atheros Communications Inc.
@@ -8453,13 +8405,6 @@
 +extern A_WAITQUEUE_HEAD arEvent;
 +extern wait_queue_head_t ar6000_scan_queue;
 +
-+#ifdef  __ATH_CENTRAL_IOCTL_DISPATCHER___
-+extern int allow_trace_signal;
-+static int ath_ioctl_dispatcher(struct net_device *dev,
-+                struct iw_request_info *info, struct iw_point *erq, char 
*key);
-+#endif
-+
-+
 +/*
 + * Encode a WPA or RSN information element as a custom
 + * element using the hostap format.
@@ -8567,26 +8512,7 @@
 +    iwe.u.data.length = 0;
 +    current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, "");
 +
-+#ifdef NOTYET
 +    A_MEMZERO(&iwe, sizeof(iwe));
-+    iwe.cmd = SIOCGIWRATE;
-+    current_val = current_ev + IW_EV_LCP_LEN;
-+    for (j = 0; j < ni->ni_rates.rs_nrates; j++) {
-+            if (ni->ni_rates.rs_rates[j]) {
-+                iwe.u.bitrate.value = ((ni->ni_rates.rs_rates[j] &
-+                    IEEE80211_RATE_VAL) / 2) * 1000000;
-+                current_val = iwe_stream_add_value(current_ev,
-+                    current_val, end_buf, &iwe,
-+                    IW_EV_PARAM_LEN);
-+            }
-+        }
-+        /* remove fixed header if no rates were added */
-+        if ((current_val - current_ev) > IW_EV_LCP_LEN)
-+            current_ev = current_val;
-+#endif /* NOTYET */
-+
-+#if WIRELESS_EXT > 14
-+    A_MEMZERO(&iwe, sizeof(iwe));
 +    iwe.cmd = IWEVCUSTOM;
 +    snprintf(buf, sizeof(buf), "bcn_int=%d", cie->ie_beaconInt);
 +    iwe.u.data.length = strlen(buf);
@@ -8645,7 +8571,6 @@
 +            current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
 +        }
 +    }
-+#endif /* WIRELESS_EXT > 14 */
 +
 +    param->current_ev = current_ev;
 +}
@@ -9387,12 +9312,12 @@
 +    return 0;
 +}
 +
-+#if 0
 +static int ar6000_ioctl_siwgenie(struct net_device *dev,
 +                               struct iw_request_info *info,
 +                               struct iw_point *dwrq,
 +                               char *extra)
 +{
++      /* The target does that for us */
 +      return 0;
 +}
 +
@@ -9507,6 +9432,7 @@
 +              break;
 +
 +      default:
++              printk("%s(): Unknown flag 0x%x\n", __FUNCTION__, param->flags);
 +              return -EOPNOTSUPP;
 +      }
 +
@@ -9526,41 +9452,84 @@
 +
 +static int ar6000_ioctl_siwencodeext(struct net_device *dev,
 +                                   struct iw_request_info *info,
-+                                   struct iw_point *dwrq,
++                                   union iwreq_data *wrqu,
 +                                   char *extra)
 +{
 +      AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++      struct iw_point *encoding = &wrqu->encoding;
 +      struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
-+      int alg = ext->alg;
++      int alg = ext->alg, idx;
 +
 +      if (ar->arWlanState == WLAN_DISABLED) {
 +              return -EIO;
 +      }
 +
-+      if ((alg == IW_ENCODE_ALG_NONE) || (dwrq->flags & IW_ENCODE_DISABLED)) {
++      /* Determine and validate the key index */
++      idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++      if (idx) {
++              if (idx < 0 || idx > 3)
++                      return -EINVAL;
++      }
 +
-+      } else if (alg == IW_ENCODE_ALG_WEP) {
++      if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) {
++              struct ieee80211req_key ik;
++              KEY_USAGE key_usage;
++              CRYPTO_TYPE key_type = NONE_CRYPT;
++              int status;
 +
-+      } else if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) {
-+              KEY_USAGE keyUsage;
-+              A_STATUS status;
-+              CRYPTO_TYPE keyType = NONE_CRYPT;
++              ar->user_saved_keys.keyOk = FALSE;
 +
++              if (alg == IW_ENCODE_ALG_TKIP) {
++                      key_type = TKIP_CRYPT;
++                      ik.ik_type = IEEE80211_CIPHER_TKIP;
++              } else {
++                      key_type = AES_CRYPT;
++                      ik.ik_type = IEEE80211_CIPHER_AES_CCM;
++              }
 +
-+              if (((alg == IW_ENCODE_ALG_TKIP) && (ext->key_len != 
KEY_LEN_WPA_TKIP))
-+                  || ((alg == IW_ENCODE_ALG_CCMP) && (ext->key_len != 
KEY_LEN_WPA_AES))) {
-+                      printk("Wrong length %d\n", ext->key_len);
-+                      return -EINVAL;
++              ik.ik_keyix = idx;
++              ik.ik_keylen = ext->key_len;
++              ik.ik_flags = IEEE80211_KEY_RECV;
++              if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
++                      ik.ik_flags |= IEEE80211_KEY_XMIT
++                              | IEEE80211_KEY_DEFAULT;
 +              }
 +
-+              if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
++              if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
++                      memcpy(&ik.ik_keyrsc, ext->rx_seq, 8);
++              }
 +
++              memcpy(ik.ik_keydata, ext->key, ext->key_len);
++
++              ar->user_saved_keys.keyType = key_type;
++              if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
++                      key_usage = GROUP_USAGE;
++                      memset(ik.ik_macaddr, 0, ETH_ALEN);
++                      memcpy(&ar->user_saved_keys.bcast_ik, &ik,
++                             sizeof(struct ieee80211req_key));
 +              } else {
++                      key_usage = PAIRWISE_USAGE;
++                      memcpy(ik.ik_macaddr, ext->addr.sa_data, ETH_ALEN);
++                      memcpy(&ar->user_saved_keys.ucast_ik, &ik,
++                             sizeof(struct ieee80211req_key));
 +              }
 +
++              status = wmi_addKey_cmd(ar->arWmi, ik.ik_keyix, key_type,
++                                      key_usage, ik.ik_keylen,
++                                      (A_UINT8 *)&ik.ik_keyrsc,
++                                      ik.ik_keydata,
++                                      KEY_OP_INIT_VAL, SYNC_BEFORE_WMIFLAG);
 +
++              if (status < 0)
++                      return -EIO;
++
++              ar->user_saved_keys.keyOk = TRUE;
++
++              return 0;
++
 +      } else {
-+              printk("Wrong alg %d\n", alg);
++              /* WEP falls back to SIWENCODE */
++              return -EOPNOTSUPP;
 +      }
 +
 +      return 0;
@@ -9574,8 +9543,8 @@
 +{
 +      return 0;
 +}
-+#endif
 +
++
 +static int
 +ar6000_ioctl_setparam(struct net_device *dev,
 +                      struct iw_request_info *info,
@@ -10242,20 +10211,6 @@
 +    (iw_handler) NULL,                          /* -- hole -- */
 +    (iw_handler) ar6000_ioctl_siwrate,          /* SIOCSIWRATE */
 +    (iw_handler) ar6000_ioctl_giwrate,          /* SIOCGIWRATE */
-+#ifdef NOTYET
-+    (iw_handler) ar6000_ioctl_siwrts,           /* SIOCSIWRTS */
-+    (iw_handler) ar6000_ioctl_giwrts,           /* SIOCGIWRTS */
-+    (iw_handler) ar6000_ioctl_siwfrag,          /* SIOCSIWFRAG */
-+    (iw_handler) ar6000_ioctl_giwfrag,          /* SIOCGIWFRAG */
-+    (iw_handler) ar6000_ioctl_siwtxpow,         /* SIOCSIWTXPOW */
-+    (iw_handler) ar6000_ioctl_giwtxpow,         /* SIOCGIWTXPOW */
-+    (iw_handler) ar6000_ioctl_siwretry,         /* SIOCSIWRETRY */
-+    (iw_handler) ar6000_ioctl_giwretry,         /* SIOCGIWRETRY */
-+    (iw_handler) ar6000_ioctl_siwencode,        /* SIOCSIWENCODE */
-+    (iw_handler) ar6000_ioctl_giwencode,        /* SIOCGIWENCODE */
-+    (iw_handler) ar6000_ioctl_siwpower,         /* SIOCSIWPOWER */
-+    (iw_handler) ar6000_ioctl_giwpower,         /* SIOCGIWPOWER */
-+#else
 +    (iw_handler) NULL,           /* SIOCSIWRTS */
 +    (iw_handler) NULL,           /* SIOCGIWRTS */
 +    (iw_handler) NULL,          /* SIOCSIWFRAG */
@@ -10270,7 +10225,6 @@
 +    (iw_handler) NULL,         /* SIOCGIWPOWER */
 +    (iw_handler) NULL,        /* -- hole -- */
 +    (iw_handler) NULL,        /* -- hole -- */
-+#if 0
 +    (iw_handler) ar6000_ioctl_siwgenie,       /* SIOCSIWGENIE */
 +    (iw_handler) ar6000_ioctl_giwgenie,       /* SIOCGIWGENIE */
 +    (iw_handler) ar6000_ioctl_siwauth,        /* SIOCSIWAUTH */
@@ -10278,9 +10232,6 @@
 +    (iw_handler) ar6000_ioctl_siwencodeext,/* SIOCSIWENCODEEXT */
 +    (iw_handler) ar6000_ioctl_giwencodeext,/* SIOCGIWENCODEEXT */
 +    (iw_handler) NULL,                /* SIOCSIWPMKSA */
-+#endif
-+
-+#endif  /* NOTYET */
 +};
 +
 +static const iw_handler ath_priv_handlers[] = {
@@ -10293,98 +10244,8 @@
 +    (iw_handler) ar6000_ioctl_setoptie,         /* SIOCWFIRSTPRIV+6 */
 +    (iw_handler) ar6000_ioctl_setmlme,          /* SIOCWFIRSTPRIV+7 */
 +    (iw_handler) ar6000_ioctl_addpmkid,         /* SIOCWFIRSTPRIV+8 */
-+    (iw_handler) NULL,                          /* SIOCWFIRSTPRIV+9 */
-+#ifdef NOT_YET
-+    (iw_handler) ar6000_ioctl_setauthalg,       /* SIOCWFIRSTPRIV+10 */
-+#endif
 +};
 +
-+
-+#ifdef __ATH_CENTRAL_IOCTL_DISPATCHER___
-+/* Structures to export the Wireless Handlers */
-+static const iw_handler ath_central_public_ioctl_handler[] = {
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWCOMMIT */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWNAME */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWNWID */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWNWID */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWFREQ */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWFREQ */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWMODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWMODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWSENS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWSENS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* not _used */          /* 
SIOCSIWRANGE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRANGE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* not used */           /* 
SIOCSIWPRIV */
-+    (iw_handler) ath_ioctl_dispatcher,          /* kernel code */        /* 
SIOCGIWPRIV */
-+    (iw_handler) ath_ioctl_dispatcher,          /* not used */           /* 
SIOCSIWSTATS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* kernel code */        /* 
SIOCGIWSTATS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWSPY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWSPY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWTHRSPY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWTHRSPY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWAP */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWAP */
-+    (iw_handler) ath_ioctl_dispatcher,          /* -- hole -- */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWAPLIST */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWSCAN */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWSCAN */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWESSID */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWESSID */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWNICKN */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWNICKN */
-+    (iw_handler) ath_ioctl_dispatcher,          /* -- hole -- */
-+    (iw_handler) ath_ioctl_dispatcher,          /* -- hole -- */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWRATE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRATE */
-+#ifdef NOTYET
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWRTS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRTS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWFRAG */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWFRAG */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWTXPOW */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWTXPOW */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWRETRY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRETRY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWENCODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWENCODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWPOWER */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWPOWER */
-+#else
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWRTS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRTS */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWFRAG */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWFRAG */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWTXPOW */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWTXPOW */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWRETRY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWRETRY */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWENCODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWENCODE */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCSIWPOWER */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCGIWPOWER */
-+#endif  /* NOTYET */
-+};
-+
-+static const iw_handler ath_central_priv_ioctl_handler[] = {
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+0 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+1 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+2 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+3 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+4 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+5 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+6 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+7 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+8 */
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+9 */
-+#ifdef NOT_YET
-+    (iw_handler) ath_ioctl_dispatcher,          /* SIOCWFIRSTPRIV+10 */
-+#endif
-+};
-+
-+#endif /* __ATH_CENTRAL_IOCTL_DISPATCHER___ */
-+
-+
 +#define IW_PRIV_TYPE_KEY \
 +    (IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_key))
 +#define IW_PRIV_TYPE_DELKEY \
@@ -10419,85 +10280,18 @@
 +
 +void ar6000_ioctl_iwsetup(struct iw_handler_def *def)
 +{
-+#define N(a) (sizeof(a) / sizeof(a[0]))
 +    def->private_args = (struct iw_priv_args *)ar6000_priv_args;
-+    def->num_private_args = N(ar6000_priv_args);
-+#undef N
++    def->num_private_args = ARRAY_SIZE(ar6000_priv_args);
 +}
 +
 +struct iw_handler_def ath_iw_handler_def = {
-+#define N(a) (sizeof (a) / sizeof (a[0]))
-+#ifdef  __ATH_CENTRAL_IOCTL_DISPATCHER___
-+    .standard         = (iw_handler *)ath_central_public_ioctl_handler,
-+    .num_standard     = N(ath_central_public_ioctl_handler),
-+    .private          = (iw_handler *)ath_central_priv_ioctl_handler,
-+    .num_private      = N(ath_central_priv_ioctl_handler),
-+#else
 +    .standard         = (iw_handler *)ath_handlers,
-+    .num_standard     = N(ath_handlers),
++    .num_standard     = ARRAY_SIZE(ath_handlers),
 +    .private          = (iw_handler *)ath_priv_handlers,
-+    .num_private      = N(ath_priv_handlers),
-+#endif /* __ATH_CENTRAL_IOCTL_DISPATCHER___ */
-+#undef N
++    .num_private      = ARRAY_SIZE(ath_priv_handlers),
 +};
 +
-+#ifdef __ATH_CENTRAL_IOCTL_DISPATCHER___
-+/* When this function is required on some platform other IBM-PC,
-+ * porting is required for that platform
-+ */
-+void
-+ath_external_trigger(int val)
-+{
-+#ifdef CONFIG_X86
-+    unsigned short iobase = 0x3f8; /* COM1 */
-+    unsigned short offset = 0x4;   /* Modem Control Register */
-+    unsigned char reg = 0;
 +
-+    if (!allow_trace_signal) {
-+            /* the setting of DTR can actually affect some terminal console 
programs (like TeraTerm)
-+             * provide a way to bypass this incase this is on by default */
-+        return;
-+    }
-+
-+    /* Bit 0 is DTR. Drive DTR */
-+    reg |= (val) ? 0x1 : 0;
-+
-+    outb(reg, iobase+offset);
-+#endif  /* CONFIG_X86 */
-+}
-+
-+static int
-+ath_ioctl_dispatcher(struct net_device *dev,
-+              struct iw_request_info *info,
-+              struct iw_point *erq, char *key)
-+{
-+    unsigned int index;
-+    int ret = -EOPNOTSUPP;
-+    const iw_handler *handlers;
-+
-+    if (info->cmd >= SIOCIWFIRSTPRIV && info->cmd <= SIOCIWLASTPRIV) {
-+        handlers = ath_priv_handlers;
-+        index = info->cmd - SIOCIWFIRSTPRIV;
-+    } else {
-+        handlers = ath_handlers;
-+        index = info->cmd - SIOCIWFIRST;
-+    }
-+
-+    if (handlers[index]) {
-+        ath_external_trigger(1);
-+        ret =  (handlers[index](dev, info, (union iwreq_data *)erq, key));
-+        if (allow_trace_signal) {
-+            /* Add some (fixed) delay for scope viewing */
-+            mdelay(5);
-+        }
-+        ath_external_trigger(0);
-+    }
-+
-+    return ret;
-+}
-+#endif /* __ATH_CENTRAL_IOCTL_DISPATCHER___ */
-+
-+
 Index: linux-2.6.24/drivers/sdio/function/wlan/ar6000/bmi/bmi.c
 ===================================================================
 --- /dev/null




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-01 02:10:57 +0100 (Fri, 01 Feb 2008)
New Revision: 4006

Modified:
   branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_hcd.patch
Log:
[PATCH 2/3] ar6k: Remove SDIO controller pending irqs check

With the recently added asynchronous SDIO interrupt bottom half code,
we don't need to double check for pending IRQs.

Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>



Modified: branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_hcd.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_hcd.patch   
2008-02-01 01:07:28 UTC (rev 4005)
+++ branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_hcd.patch   
2008-02-01 01:10:57 UTC (rev 4006)
@@ -34,7 +34,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c
-@@ -0,0 +1,1510 @@
+@@ -0,0 +1,1502 @@
 +/*
 + * s3c24xx_hcd.c - Samsung S3C MCI driver, Atheros SDIO API compatible.
 + *
@@ -800,8 +800,6 @@
 +                      imask &= ~S3C2410_SDIIMSK_SDIOIRQ;
 +                      writel(imask, context->base + S3C2440_SDIIMSK);
 +                      schedule_work(&context->irq_work);
-+              } else {
-+                      context->int_pending = 1;
 +              }
 +      }
 +
@@ -955,11 +953,6 @@
 +        case SDCONFIG_SDIO_REARM_INT:
 +              DBG_PRINT(SDDBG_TRACE, ("config SDIO_REARM_INT\n"));
 +
-+              if (context->int_pending) {
-+                      context->int_pending = 0;
-+                      schedule_work(&context->irq_work);
-+              }
-+
 +              context->int_sdio = 1;
 +              imsk = readl(context->base + S3C2440_SDIIMSK);
 +              imsk |= S3C2410_SDIIMSK_SDIOIRQ;
@@ -1378,7 +1371,6 @@
 +      hcd_context.dma_en = 0;
 +
 +      hcd_context.int_sdio = 0;
-+      hcd_context.int_pending = 0;
 +
 +      spin_lock_init(&hcd_context.lock);
 +
@@ -1549,7 +1541,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.h
-@@ -0,0 +1,68 @@
+@@ -0,0 +1,67 @@
 +#ifndef __SDIO_S3C24XX_HCD_H___
 +#define __SDIO_S3C24XX_HCD_H___
 +
@@ -1598,7 +1590,6 @@
 +
 +      UINT32                    int_mask;
 +      UINT32                    int_sdio;            /* Do we have SDIO 
interrupt on ? */
-+      UINT32                    int_pending;
 +
 +      UINT32                    complete;
 +




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-01 02:14:17 +0100 (Fri, 01 Feb 2008)
New Revision: 4007

Modified:
   branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch
Log:
[PATCH 3/3] ar6k: SIWPOWER implementation

This is a basic power management switch for ar6k, using the standard
SIWPOWER wireless extension.

Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>



Modified: branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch      
2008-02-01 01:10:57 UTC (rev 4006)
+++ branches/src/target/kernel/2.6.24.x/patches/atheros_2_0_function.patch      
2008-02-01 01:14:17 UTC (rev 4007)
@@ -8377,7 +8377,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
-@@ -0,0 +1,1914 @@
+@@ -0,0 +1,1941 @@
 +/*
 + *
 + * Copyright (c) 2004-2007 Atheros Communications Inc.
@@ -9270,7 +9270,7 @@
 +              struct iw_request_info *info,
 +              struct iw_point *erq, char *key)
 +{
-+    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
++    AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
 +    A_UINT8 keyIndex;
 +    struct ar_wep_key *wk;
 +
@@ -9312,6 +9312,33 @@
 +    return 0;
 +}
 +
++static int ar6000_ioctl_siwpower(struct net_device *dev,
++                               struct iw_request_info *info,
++                               union iwreq_data *wrqu, char *extra)
++{
++      AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++      WMI_POWER_MODE power_mode;
++
++      if (wrqu->power.disabled)
++              power_mode = MAX_PERF_POWER;
++      else
++              power_mode = REC_POWER;
++
++      if (wmi_powermode_cmd(ar->arWmi, power_mode) < 0)
++              return -EIO;
++
++      return 0;
++}
++
++static int ar6000_ioctl_giwpower(struct net_device *dev,
++                               struct iw_request_info *info,
++                               union iwreq_data *wrqu, char *extra)
++{
++      AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++      return wmi_get_power_mode_cmd(ar->arWmi);
++}
++
 +static int ar6000_ioctl_siwgenie(struct net_device *dev,
 +                               struct iw_request_info *info,
 +                               struct iw_point *dwrq,
@@ -10221,8 +10248,8 @@
 +    (iw_handler) ar6000_ioctl_giwretry,         /* SIOCGIWRETRY */
 +    (iw_handler) ar6000_ioctl_siwencode,        /* SIOCSIWENCODE */
 +    (iw_handler) ar6000_ioctl_giwencode,        /* SIOCGIWENCODE */
-+    (iw_handler) NULL,         /* SIOCSIWPOWER */
-+    (iw_handler) NULL,         /* SIOCGIWPOWER */
++    (iw_handler) ar6000_ioctl_siwpower,         /* SIOCSIWPOWER */
++    (iw_handler) ar6000_ioctl_giwpower,         /* SIOCGIWPOWER */
 +    (iw_handler) NULL,        /* -- hole -- */
 +    (iw_handler) NULL,        /* -- hole -- */
 +    (iw_handler) ar6000_ioctl_siwgenie,       /* SIOCSIWGENIE */




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to