diff options
author | David Kilroy <kilroyd@googlemail.com> | 2009-08-05 16:23:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:12:42 -0400 |
commit | 07542d08ee573b6d8281f38430117b52fccaf50a (patch) | |
tree | a2ad2dd7b1a45a9c81f4e7989e42fc2c1c01226a /drivers/net | |
parent | 16e158480d542f3909b5aca8b125af986ae128c1 (diff) |
orinoco: move disassociation to hw.c
This allows the disassociation to be called via cfg80211.
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/orinoco/hw.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco/wext.c | 17 |
3 files changed, 30 insertions, 13 deletions
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c index 35516a9e2a30..3e9021c47783 100644 --- a/drivers/net/wireless/orinoco/hw.c +++ b/drivers/net/wireless/orinoco/hw.c | |||
@@ -1248,3 +1248,27 @@ int orinoco_hw_trigger_scan(struct orinoco_private *priv, | |||
1248 | 1248 | ||
1249 | return err; | 1249 | return err; |
1250 | } | 1250 | } |
1251 | |||
1252 | /* Disassociate from node with BSSID addr */ | ||
1253 | int orinoco_hw_disassociate(struct orinoco_private *priv, | ||
1254 | u8 *addr, u16 reason_code) | ||
1255 | { | ||
1256 | hermes_t *hw = &priv->hw; | ||
1257 | int err; | ||
1258 | |||
1259 | struct { | ||
1260 | u8 addr[ETH_ALEN]; | ||
1261 | __le16 reason_code; | ||
1262 | } __attribute__ ((packed)) buf; | ||
1263 | |||
1264 | /* Currently only supported by WPA enabled Agere fw */ | ||
1265 | if (!priv->has_wpa) | ||
1266 | return -EOPNOTSUPP; | ||
1267 | |||
1268 | memcpy(buf.addr, addr, ETH_ALEN); | ||
1269 | buf.reason_code = cpu_to_le16(reason_code); | ||
1270 | err = HERMES_WRITE_RECORD(hw, USER_BAP, | ||
1271 | HERMES_RID_CNFDISASSOCIATE, | ||
1272 | &buf); | ||
1273 | return err; | ||
1274 | } | ||
diff --git a/drivers/net/wireless/orinoco/hw.h b/drivers/net/wireless/orinoco/hw.h index 33a31fa7c625..b096786a93db 100644 --- a/drivers/net/wireless/orinoco/hw.h +++ b/drivers/net/wireless/orinoco/hw.h | |||
@@ -51,5 +51,7 @@ int orinoco_hw_get_bitratelist(struct orinoco_private *priv, | |||
51 | int *numrates, s32 *rates, int max); | 51 | int *numrates, s32 *rates, int max); |
52 | int orinoco_hw_trigger_scan(struct orinoco_private *priv, | 52 | int orinoco_hw_trigger_scan(struct orinoco_private *priv, |
53 | const struct cfg80211_ssid *ssid); | 53 | const struct cfg80211_ssid *ssid); |
54 | int orinoco_hw_disassociate(struct orinoco_private *priv, | ||
55 | u8 *addr, u16 reason_code); | ||
54 | 56 | ||
55 | #endif /* _ORINOCO_HW_H_ */ | 57 | #endif /* _ORINOCO_HW_H_ */ |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index 7e18bb404935..f324bf919bc8 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -1136,7 +1136,6 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev, | |||
1136 | union iwreq_data *wrqu, char *extra) | 1136 | union iwreq_data *wrqu, char *extra) |
1137 | { | 1137 | { |
1138 | struct orinoco_private *priv = ndev_priv(dev); | 1138 | struct orinoco_private *priv = ndev_priv(dev); |
1139 | hermes_t *hw = &priv->hw; | ||
1140 | struct iw_mlme *mlme = (struct iw_mlme *)extra; | 1139 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
1141 | unsigned long flags; | 1140 | unsigned long flags; |
1142 | int ret = 0; | 1141 | int ret = 0; |
@@ -1150,19 +1149,11 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev, | |||
1150 | break; | 1149 | break; |
1151 | 1150 | ||
1152 | case IW_MLME_DISASSOC: | 1151 | case IW_MLME_DISASSOC: |
1153 | { | 1152 | |
1154 | struct { | 1153 | ret = orinoco_hw_disassociate(priv, mlme->addr.sa_data, |
1155 | u8 addr[ETH_ALEN]; | 1154 | mlme->reason_code); |
1156 | __le16 reason_code; | ||
1157 | } __attribute__ ((packed)) buf; | ||
1158 | |||
1159 | memcpy(buf.addr, mlme->addr.sa_data, ETH_ALEN); | ||
1160 | buf.reason_code = cpu_to_le16(mlme->reason_code); | ||
1161 | ret = HERMES_WRITE_RECORD(hw, USER_BAP, | ||
1162 | HERMES_RID_CNFDISASSOCIATE, | ||
1163 | &buf); | ||
1164 | break; | 1155 | break; |
1165 | } | 1156 | |
1166 | default: | 1157 | default: |
1167 | ret = -EOPNOTSUPP; | 1158 | ret = -EOPNOTSUPP; |
1168 | } | 1159 | } |