Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90483
b: refs/heads/master
c: 7460f5a
h: refs/heads/master
i:
  90481: 56216ce
  90479: 74fe0c0
v: v3
  • Loading branch information
Holger Schurig authored and John W. Linville committed Apr 1, 2008
1 parent 3254de2 commit 34972a6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 122 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2af9f039a17c0acd9e5b21d10058688687bad86d
refs/heads/master: 7460f5a69055357bf97f1890db547aba0c4bf2fa
25 changes: 0 additions & 25 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,27 +953,6 @@ static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
return 0;
}

static int lbs_cmd_802_11_eeprom_access(struct cmd_ds_command *cmd,
void *pdata_buf)
{
struct lbs_ioctl_regrdwr *ea = pdata_buf;

lbs_deb_enter(LBS_DEB_CMD);

cmd->command = cpu_to_le16(CMD_802_11_EEPROM_ACCESS);
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) +
S_DS_GEN);
cmd->result = 0;

cmd->params.rdeeprom.action = cpu_to_le16(ea->action);
cmd->params.rdeeprom.offset = cpu_to_le16(ea->offset);
cmd->params.rdeeprom.bytecount = cpu_to_le16(ea->NOB);
cmd->params.rdeeprom.value = 0;

lbs_deb_leave(LBS_DEB_CMD);
return 0;
}

static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
u16 cmd_action, void *pdata_buf)
{
Expand Down Expand Up @@ -1412,10 +1391,6 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
ret = lbs_cmd_80211_ad_hoc_stop(cmdptr);
break;

case CMD_802_11_EEPROM_ACCESS:
ret = lbs_cmd_802_11_eeprom_access(cmdptr, pdata_buf);
break;

case CMD_802_11_SET_AFC:
case CMD_802_11_GET_AFC:

Expand Down
29 changes: 0 additions & 29 deletions trunk/drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,31 +249,6 @@ static int lbs_ret_802_11_rssi(struct lbs_private *priv,
return 0;
}

static int lbs_ret_802_11_eeprom_access(struct lbs_private *priv,
struct cmd_ds_command *resp)
{
struct lbs_ioctl_regrdwr *pbuf;
pbuf = (struct lbs_ioctl_regrdwr *) priv->prdeeprom;

lbs_deb_enter_args(LBS_DEB_CMD, "len %d",
le16_to_cpu(resp->params.rdeeprom.bytecount));
if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) {
pbuf->NOB = 0;
lbs_deb_cmd("EEPROM read length too big\n");
return -1;
}
pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount);
if (pbuf->NOB > 0) {

memcpy(&pbuf->value, (u8 *) & resp->params.rdeeprom.value,
le16_to_cpu(resp->params.rdeeprom.bytecount));
lbs_deb_hex(LBS_DEB_CMD, "EEPROM", (char *)&pbuf->value,
le16_to_cpu(resp->params.rdeeprom.bytecount));
}
lbs_deb_leave(LBS_DEB_CMD);
return 0;
}

static int lbs_ret_802_11_bcn_ctrl(struct lbs_private * priv,
struct cmd_ds_command *resp)
{
Expand Down Expand Up @@ -359,10 +334,6 @@ static inline int handle_cmd_response(struct lbs_private *priv,
ret = lbs_ret_80211_ad_hoc_stop(priv);
break;

case CMD_RET(CMD_802_11_EEPROM_ACCESS):
ret = lbs_ret_802_11_eeprom_access(priv, resp);
break;

case CMD_RET(CMD_802_11D_DOMAIN_INFO):
ret = lbs_ret_802_11d_domain_info(resp);
break;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ struct lbs_private {
u32 enable11d;

/** MISCELLANEOUS */
u8 *prdeeprom;
struct lbs_offset_value offsetvalue;

u32 monitormode;
Expand Down
67 changes: 17 additions & 50 deletions trunk/drivers/net/wireless/libertas/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,61 +48,28 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev,
struct ethtool_eeprom *eeprom, u8 * bytes)
{
struct lbs_private *priv = (struct lbs_private *) dev->priv;
struct lbs_ioctl_regrdwr regctrl;
char *ptr;
struct cmd_ds_802_11_eeprom_access cmd;
int ret;

regctrl.action = 0;
regctrl.offset = eeprom->offset;
regctrl.NOB = eeprom->len;

if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN)
return -EINVAL;

// mutex_lock(&priv->mutex);

priv->prdeeprom = kmalloc(eeprom->len+sizeof(regctrl), GFP_KERNEL);
if (!priv->prdeeprom)
return -ENOMEM;
memcpy(priv->prdeeprom, &regctrl, sizeof(regctrl));

/* +14 is for action, offset, and NOB in
* response */
lbs_deb_ethtool("action:%d offset: %x NOB: %02x\n",
regctrl.action, regctrl.offset, regctrl.NOB);
lbs_deb_enter(LBS_DEB_ETHTOOL);

ret = lbs_prepare_and_send_command(priv,
CMD_802_11_EEPROM_ACCESS,
regctrl.action,
CMD_OPTION_WAITFORRSP, 0,
&regctrl);

if (ret) {
if (priv->prdeeprom)
kfree(priv->prdeeprom);
goto done;
if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN ||
eeprom->len > LBS_EEPROM_READ_LEN) {
ret = -EINVAL;
goto out;
}

mdelay(10);

ptr = (char *)priv->prdeeprom;

/* skip the command header, but include the "value" u32 variable */
ptr = ptr + sizeof(struct lbs_ioctl_regrdwr) - 4;

/*
* Return the result back to the user
*/
memcpy(bytes, ptr, eeprom->len);

if (priv->prdeeprom)
kfree(priv->prdeeprom);
// mutex_unlock(&priv->mutex);

ret = 0;

done:
lbs_deb_enter_args(LBS_DEB_ETHTOOL, "ret %d", ret);
cmd.hdr.size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) -
LBS_EEPROM_READ_LEN + eeprom->len);
cmd.action = cpu_to_le16(CMD_ACT_GET);
cmd.offset = cpu_to_le16(eeprom->offset);
cmd.len = cpu_to_le16(eeprom->len);
ret = lbs_cmd_with_response(priv, CMD_802_11_EEPROM_ACCESS, &cmd);
if (!ret)
memcpy(bytes, cmd.value, eeprom->len);

out:
lbs_deb_leave_args(LBS_DEB_ETHTOOL, "ret %d", ret);
return ret;
}

Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/wireless/libertas/hostcmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,13 @@ struct cmd_ds_802_11_key_material {
} __attribute__ ((packed));

struct cmd_ds_802_11_eeprom_access {
struct cmd_header hdr;
__le16 action;

/* multiple 4 */
__le16 offset;
__le16 bytecount;
u8 value;
__le16 len;
/* firmware says it returns a maximum of 20 bytes */
#define LBS_EEPROM_READ_LEN 20
u8 value[LBS_EEPROM_READ_LEN];
} __attribute__ ((packed));

struct cmd_ds_802_11_tpc_cfg {
Expand Down Expand Up @@ -713,7 +714,6 @@ struct cmd_ds_command {
struct cmd_ds_mac_reg_access macreg;
struct cmd_ds_bbp_reg_access bbpreg;
struct cmd_ds_rf_reg_access rfreg;
struct cmd_ds_802_11_eeprom_access rdeeprom;

struct cmd_ds_802_11d_domain_info domaininfo;
struct cmd_ds_802_11d_domain_info domaininforesp;
Expand Down
11 changes: 0 additions & 11 deletions trunk/drivers/net/wireless/libertas/wext.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
#ifndef _LBS_WEXT_H_
#define _LBS_WEXT_H_

/** lbs_ioctl_regrdwr */
struct lbs_ioctl_regrdwr {
/** Which register to access */
u16 whichreg;
/** Read or Write */
u16 action;
u32 offset;
u16 NOB;
u32 value;
};

extern struct iw_handler_def lbs_handler_def;
extern struct iw_handler_def mesh_handler_def;

Expand Down

0 comments on commit 34972a6

Please sign in to comment.