aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/libertas/cmd.c25
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c29
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/ethtool.c67
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h10
-rw-r--r--drivers/net/wireless/libertas/wext.h11
6 files changed, 22 insertions, 121 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index d396a5f06666..6e7bfb36b491 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -953,27 +953,6 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
953 return 0; 953 return 0;
954} 954}
955 955
956static int lbs_cmd_802_11_eeprom_access(struct cmd_ds_command *cmd,
957 void *pdata_buf)
958{
959 struct lbs_ioctl_regrdwr *ea = pdata_buf;
960
961 lbs_deb_enter(LBS_DEB_CMD);
962
963 cmd->command = cpu_to_le16(CMD_802_11_EEPROM_ACCESS);
964 cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) +
965 S_DS_GEN);
966 cmd->result = 0;
967
968 cmd->params.rdeeprom.action = cpu_to_le16(ea->action);
969 cmd->params.rdeeprom.offset = cpu_to_le16(ea->offset);
970 cmd->params.rdeeprom.bytecount = cpu_to_le16(ea->NOB);
971 cmd->params.rdeeprom.value = 0;
972
973 lbs_deb_leave(LBS_DEB_CMD);
974 return 0;
975}
976
977static int lbs_cmd_bt_access(struct cmd_ds_command *cmd, 956static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
978 u16 cmd_action, void *pdata_buf) 957 u16 cmd_action, void *pdata_buf)
979{ 958{
@@ -1412,10 +1391,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
1412 ret = lbs_cmd_80211_ad_hoc_stop(cmdptr); 1391 ret = lbs_cmd_80211_ad_hoc_stop(cmdptr);
1413 break; 1392 break;
1414 1393
1415 case CMD_802_11_EEPROM_ACCESS:
1416 ret = lbs_cmd_802_11_eeprom_access(cmdptr, pdata_buf);
1417 break;
1418
1419 case CMD_802_11_SET_AFC: 1394 case CMD_802_11_SET_AFC:
1420 case CMD_802_11_GET_AFC: 1395 case CMD_802_11_GET_AFC:
1421 1396
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index c3b80c139d4f..8b5d1a55a0e9 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -249,31 +249,6 @@ static int lbs_ret_802_11_rssi(struct lbs_private *priv,
249 return 0; 249 return 0;
250} 250}
251 251
252static int lbs_ret_802_11_eeprom_access(struct lbs_private *priv,
253 struct cmd_ds_command *resp)
254{
255 struct lbs_ioctl_regrdwr *pbuf;
256 pbuf = (struct lbs_ioctl_regrdwr *) priv->prdeeprom;
257
258 lbs_deb_enter_args(LBS_DEB_CMD, "len %d",
259 le16_to_cpu(resp->params.rdeeprom.bytecount));
260 if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) {
261 pbuf->NOB = 0;
262 lbs_deb_cmd("EEPROM read length too big\n");
263 return -1;
264 }
265 pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount);
266 if (pbuf->NOB > 0) {
267
268 memcpy(&pbuf->value, (u8 *) & resp->params.rdeeprom.value,
269 le16_to_cpu(resp->params.rdeeprom.bytecount));
270 lbs_deb_hex(LBS_DEB_CMD, "EEPROM", (char *)&pbuf->value,
271 le16_to_cpu(resp->params.rdeeprom.bytecount));
272 }
273 lbs_deb_leave(LBS_DEB_CMD);
274 return 0;
275}
276
277static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv, 252static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv,
278 struct cmd_ds_command *resp) 253 struct cmd_ds_command *resp)
279{ 254{
@@ -359,10 +334,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
359 ret = lbs_ret_80211_ad_hoc_stop(priv); 334 ret = lbs_ret_80211_ad_hoc_stop(priv);
360 break; 335 break;
361 336
362 case CMD_RET(CMD_802_11_EEPROM_ACCESS):
363 ret = lbs_ret_802_11_eeprom_access(priv, resp);
364 break;
365
366 case CMD_RET(CMD_802_11D_DOMAIN_INFO): 337 case CMD_RET(CMD_802_11D_DOMAIN_INFO):
367 ret = lbs_ret_802_11d_domain_info(resp); 338 ret = lbs_ret_802_11d_domain_info(resp);
368 break; 339 break;
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 17e02bed6bfa..8e770dd6ef6b 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -320,7 +320,6 @@ struct lbs_private {
320 u32 enable11d; 320 u32 enable11d;
321 321
322 /** MISCELLANEOUS */ 322 /** MISCELLANEOUS */
323 u8 *prdeeprom;
324 struct lbs_offset_value offsetvalue; 323 struct lbs_offset_value offsetvalue;
325 324
326 u32 monitormode; 325 u32 monitormode;
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 21e6f988ea81..7c8ce7d0f23a 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -48,61 +48,28 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev,
48 struct ethtool_eeprom *eeprom, u8 * bytes) 48 struct ethtool_eeprom *eeprom, u8 * bytes)
49{ 49{
50 struct lbs_private *priv = (struct lbs_private *) dev->priv; 50 struct lbs_private *priv = (struct lbs_private *) dev->priv;
51 struct lbs_ioctl_regrdwr regctrl; 51 struct cmd_ds_802_11_eeprom_access cmd;
52 char *ptr;
53 int ret; 52 int ret;
54 53
55 regctrl.action = 0; 54 lbs_deb_enter(LBS_DEB_ETHTOOL);
56 regctrl.offset = eeprom->offset;
57 regctrl.NOB = eeprom->len;
58
59 if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN)
60 return -EINVAL;
61
62// mutex_lock(&priv->mutex);
63
64 priv->prdeeprom = kmalloc(eeprom->len+sizeof(regctrl), GFP_KERNEL);
65 if (!priv->prdeeprom)
66 return -ENOMEM;
67 memcpy(priv->prdeeprom, &regctrl, sizeof(regctrl));
68
69 /* +14 is for action, offset, and NOB in
70 * response */
71 lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n",
72 regctrl.action, regctrl.offset, regctrl.NOB);
73 55
74 ret = lbs_prepare_and_send_command(priv, 56 if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN ||
75 CMD_802_11_EEPROM_ACCESS, 57 eeprom->len > LBS_EEPROM_READ_LEN) {
76 regctrl.action, 58 ret = -EINVAL;
77 CMD_OPTION_WAITFORRSP, 0, 59 goto out;
78 &regctrl);
79
80 if (ret) {
81 if (priv->prdeeprom)
82 kfree(priv->prdeeprom);
83 goto done;
84 } 60 }
85 61
86 mdelay(10); 62 cmd.hdr.size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) -
87 63 LBS_EEPROM_READ_LEN + eeprom->len);
88 ptr = (char *)priv->prdeeprom; 64 cmd.action = cpu_to_le16(CMD_ACT_GET);
89 65 cmd.offset = cpu_to_le16(eeprom->offset);
90 /* skip the command header, but include the "value" u32 variable */ 66 cmd.len = cpu_to_le16(eeprom->len);
91 ptr = ptr + sizeof(struct lbs_ioctl_regrdwr) - 4; 67 ret = lbs_cmd_with_response(priv, CMD_802_11_EEPROM_ACCESS, &cmd);
92 68 if (!ret)
93 /* 69 memcpy(bytes, cmd.value, eeprom->len);
94 * Return the result back to the user 70
95 */ 71out:
96 memcpy(bytes, ptr, eeprom->len); 72 lbs_deb_leave_args(LBS_DEB_ETHTOOL, "ret %d", ret);
97
98 if (priv->prdeeprom)
99 kfree(priv->prdeeprom);
100// mutex_unlock(&priv->mutex);
101
102 ret = 0;
103
104done:
105 lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
106 return ret; 73 return ret;
107} 74}
108 75
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index e56d0049f5fd..9256daba48fc 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -588,12 +588,13 @@ struct cmd_ds_802_11_key_material {
588} __attribute__ ((packed)); 588} __attribute__ ((packed));
589 589
590struct cmd_ds_802_11_eeprom_access { 590struct cmd_ds_802_11_eeprom_access {
591 struct cmd_header hdr;
591 __le16 action; 592 __le16 action;
592
593 /* multiple 4 */
594 __le16 offset; 593 __le16 offset;
595 __le16 bytecount; 594 __le16 len;
596 u8 value; 595 /* firmware says it returns a maximum of 20 bytes */
596#define LBS_EEPROM_READ_LEN 20
597 u8 value[LBS_EEPROM_READ_LEN];
597} __attribute__ ((packed)); 598} __attribute__ ((packed));
598 599
599struct cmd_ds_802_11_tpc_cfg { 600struct cmd_ds_802_11_tpc_cfg {
@@ -713,7 +714,6 @@ struct cmd_ds_command {
713 struct cmd_ds_mac_reg_access macreg; 714 struct cmd_ds_mac_reg_access macreg;
714 struct cmd_ds_bbp_reg_access bbpreg; 715 struct cmd_ds_bbp_reg_access bbpreg;
715 struct cmd_ds_rf_reg_access rfreg; 716 struct cmd_ds_rf_reg_access rfreg;
716 struct cmd_ds_802_11_eeprom_access rdeeprom;
717 717
718 struct cmd_ds_802_11d_domain_info domaininfo; 718 struct cmd_ds_802_11d_domain_info domaininfo;
719 struct cmd_ds_802_11d_domain_info domaininforesp; 719 struct cmd_ds_802_11d_domain_info domaininforesp;
diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h
index f0f439a6ab49..4c08db497606 100644
--- a/drivers/net/wireless/libertas/wext.h
+++ b/drivers/net/wireless/libertas/wext.h
@@ -4,17 +4,6 @@
4#ifndef _LBS_WEXT_H_ 4#ifndef _LBS_WEXT_H_
5#define _LBS_WEXT_H_ 5#define _LBS_WEXT_H_
6 6
7/** lbs_ioctl_regrdwr */
8struct lbs_ioctl_regrdwr {
9 /** Which register to access */
10 u16 whichreg;
11 /** Read or Write */
12 u16 action;
13 u32 offset;
14 u16 NOB;
15 u32 value;
16};
17
18extern struct iw_handler_def lbs_handler_def; 7extern struct iw_handler_def lbs_handler_def;
19extern struct iw_handler_def mesh_handler_def; 8extern struct iw_handler_def mesh_handler_def;
20 9