orinoco: add function to retrieve current bssid
authorDavid Kilroy <kilroyd@googlemail.com>
Wed, 5 Aug 2009 20:23:31 +0000 (21:23 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Aug 2009 13:12:44 +0000 (09:12 -0400)
We will need this from the cfg80211 disassociate call.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco/hw.c
drivers/net/wireless/orinoco/hw.h
drivers/net/wireless/orinoco/wext.c

index 3e9021c47783992f1396b3690e0b9ff7bd1b2bec..5b126542692247bb907f5e7c4bbbee58141f6ee8 100644 (file)
@@ -1272,3 +1272,15 @@ int orinoco_hw_disassociate(struct orinoco_private *priv,
                                  &buf);
        return err;
 }
+
+int orinoco_hw_get_current_bssid(struct orinoco_private *priv,
+                                u8 *addr)
+{
+       hermes_t *hw = &priv->hw;
+       int err;
+
+       err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID,
+                             ETH_ALEN, NULL, addr);
+
+       return err;
+}
index b096786a93db047da78b2fb3450c78ed45750718..8df6e8752be6baf8ffd5bf2c47d145c349e900d6 100644 (file)
@@ -53,5 +53,7 @@ int orinoco_hw_trigger_scan(struct orinoco_private *priv,
                            const struct cfg80211_ssid *ssid);
 int orinoco_hw_disassociate(struct orinoco_private *priv,
                            u8 *addr, u16 reason_code);
+int orinoco_hw_get_current_bssid(struct orinoco_private *priv,
+                                u8 *addr);
 
 #endif /* _ORINOCO_HW_H_ */
index f324bf919bc8c3316e2f2271ea2afe17df68c2f9..f68bbe383e0f758c6a3ba2bf805d6ac09929f08c 100644 (file)
@@ -156,7 +156,6 @@ static int orinoco_ioctl_getwap(struct net_device *dev,
 {
        struct orinoco_private *priv = ndev_priv(dev);
 
-       hermes_t *hw = &priv->hw;
        int err = 0;
        unsigned long flags;
 
@@ -164,8 +163,7 @@ static int orinoco_ioctl_getwap(struct net_device *dev,
                return -EBUSY;
 
        ap_addr->sa_family = ARPHRD_ETHER;
-       err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID,
-                             ETH_ALEN, NULL, ap_addr->sa_data);
+       err = orinoco_hw_get_current_bssid(priv, ap_addr->sa_data);
 
        orinoco_unlock(priv, &flags);