Commit 07542d08 authored by David Kilroy's avatar David Kilroy Committed by John W. Linville

orinoco: move disassociation to hw.c

This allows the disassociation to be called via cfg80211.
Signed-off-by: default avatarDavid Kilroy <kilroyd@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 16e15848
...@@ -1248,3 +1248,27 @@ int orinoco_hw_trigger_scan(struct orinoco_private *priv, ...@@ -1248,3 +1248,27 @@ int orinoco_hw_trigger_scan(struct orinoco_private *priv,
return err; return err;
} }
/* Disassociate from node with BSSID addr */
int orinoco_hw_disassociate(struct orinoco_private *priv,
u8 *addr, u16 reason_code)
{
hermes_t *hw = &priv->hw;
int err;
struct {
u8 addr[ETH_ALEN];
__le16 reason_code;
} __attribute__ ((packed)) buf;
/* Currently only supported by WPA enabled Agere fw */
if (!priv->has_wpa)
return -EOPNOTSUPP;
memcpy(buf.addr, addr, ETH_ALEN);
buf.reason_code = cpu_to_le16(reason_code);
err = HERMES_WRITE_RECORD(hw, USER_BAP,
HERMES_RID_CNFDISASSOCIATE,
&buf);
return err;
}
...@@ -51,5 +51,7 @@ int orinoco_hw_get_bitratelist(struct orinoco_private *priv, ...@@ -51,5 +51,7 @@ int orinoco_hw_get_bitratelist(struct orinoco_private *priv,
int *numrates, s32 *rates, int max); int *numrates, s32 *rates, int max);
int orinoco_hw_trigger_scan(struct orinoco_private *priv, int orinoco_hw_trigger_scan(struct orinoco_private *priv,
const struct cfg80211_ssid *ssid); const struct cfg80211_ssid *ssid);
int orinoco_hw_disassociate(struct orinoco_private *priv,
u8 *addr, u16 reason_code);
#endif /* _ORINOCO_HW_H_ */ #endif /* _ORINOCO_HW_H_ */
...@@ -1136,7 +1136,6 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev, ...@@ -1136,7 +1136,6 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
struct orinoco_private *priv = ndev_priv(dev); struct orinoco_private *priv = ndev_priv(dev);
hermes_t *hw = &priv->hw;
struct iw_mlme *mlme = (struct iw_mlme *)extra; struct iw_mlme *mlme = (struct iw_mlme *)extra;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -1150,19 +1149,11 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev, ...@@ -1150,19 +1149,11 @@ static int orinoco_ioctl_set_mlme(struct net_device *dev,
break; break;
case IW_MLME_DISASSOC: case IW_MLME_DISASSOC:
{
struct { ret = orinoco_hw_disassociate(priv, mlme->addr.sa_data,
u8 addr[ETH_ALEN]; mlme->reason_code);
__le16 reason_code;
} __attribute__ ((packed)) buf;
memcpy(buf.addr, mlme->addr.sa_data, ETH_ALEN);
buf.reason_code = cpu_to_le16(mlme->reason_code);
ret = HERMES_WRITE_RECORD(hw, USER_BAP,
HERMES_RID_CNFDISASSOCIATE,
&buf);
break; break;
}
default: default:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment