u8 mode = (u8) (size_t) pdata_buf;
pSNMPMIB->querytype = cpu_to_le16(CMD_ACT_SET);
pSNMPMIB->oid = cpu_to_le16((u16) DESIRED_BSSTYPE_I);
- pSNMPMIB->bufsize = sizeof(u8);
+ pSNMPMIB->bufsize = cpu_to_le16(sizeof(u8));
if (mode == IW_MODE_ADHOC) {
ucTemp = SNMP_MIB_VALUE_ADHOC;
} else {
pSNMPMIB->oid = cpu_to_le16((u16) DOT11D_I);
if (cmd_action == CMD_ACT_SET) {
- pSNMPMIB->querytype = CMD_ACT_SET;
- pSNMPMIB->bufsize = sizeof(u16);
+ pSNMPMIB->querytype = cpu_to_le16(CMD_ACT_SET);
+ pSNMPMIB->bufsize = cpu_to_le16(sizeof(u16));
ulTemp = *(u32 *)pdata_buf;
*((__le16 *)(pSNMPMIB->value)) =
cpu_to_le16((u16) ulTemp);
{
u32 ulTemp;
- pSNMPMIB->oid = le16_to_cpu((u16) RTSTHRESH_I);
+ pSNMPMIB->oid = cpu_to_le16(RTSTHRESH_I);
if (cmd_action == CMD_ACT_GET) {
pSNMPMIB->querytype = cpu_to_le16(CMD_ACT_GET);
offval = (struct lbs_offset_value *)pdata_buf;
- switch (cmdptr->command) {
+ switch (le16_to_cpu(cmdptr->command)) {
case CMD_MAC_REG_ACCESS:
{
struct cmd_ds_mac_reg_access *macreg;
}
/* Exit_PS command needs to be queued in the header always. */
- if (cmdptr->command == CMD_802_11_PS_MODE) {
+ if (le16_to_cpu(cmdptr->command) == CMD_802_11_PS_MODE) {
struct cmd_ds_802_11_ps_mode *psm = &cmdptr->params.psmode;
if (psm->action == cpu_to_le16(CMD_SUBCMD_EXIT_PS)) {
if (adapter->psstate != PS_STATE_FULL_POWER)
adapter->cur_cmd_retcode = 0;
spin_unlock_irqrestore(&adapter->driver_lock, flags);
- cmdsize = cmdptr->size;
- command = cpu_to_le16(cmdptr->command);
+ cmdsize = le16_to_cpu(cmdptr->size);
+ command = le16_to_cpu(cmdptr->command);
lbs_deb_host("DNLD_CMD: command 0x%04x, size %d, jiffies %lu\n",
- command, le16_to_cpu(cmdptr->size), jiffies);
+ command, cmdsize, jiffies);
lbs_deb_hex(LBS_DEB_HOST, "DNLD_CMD", cmdnode->bufvirtualaddr, cmdsize);
cmdnode->cmdwaitqwoken = 0;
- cmdsize = cpu_to_le16(cmdsize);
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmdptr, cmdsize);
#define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8
cmdptr->size =
- cpu_to_le16(gpio->header.len + S_DS_GEN +
- ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
- gpio->header.len = cpu_to_le16(gpio->header.len);
+ cpu_to_le16(le16_to_cpu(gpio->header.len)
+ + S_DS_GEN
+ + ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
+ gpio->header.len = gpio->header.len;
ret = 0;
break;
{
struct cmd_ds_gen *r = (struct cmd_ds_gen *)resp;
struct lbs_adapter *adapter = priv->adapter;
- u16 sz = cpu_to_le16(resp->size) - S_DS_GEN;
+ u16 sz = le16_to_cpu(resp->size) - S_DS_GEN;
if (sz > *adapter->cur_cmd->pdata_size) {
lbs_pr_err("response 0x%04x doesn't fit into buffer (%d > %d)\n",
int rsp_len = sizeof(b2_cmd);
b2_cmd.action = 0;
- b2_cmd.version = cpu_to_le16(priv->boot2_version);
+ b2_cmd.version = priv->boot2_version;
if (lbs_cmd(priv, CMD_SET_BOOT2_VER, &b2_cmd, sizeof(b2_cmd),
&b2_cmd, &rsp_len)) {
priv->hw_host_to_card = if_usb_host_to_card;
priv->hw_get_int_status = if_usb_get_int_status;
priv->hw_read_event_cause = if_usb_read_event_cause;
- priv->boot2_version = le16_to_cpu(udev->descriptor.bcdDevice);
+ priv->boot2_version = udev->descriptor.bcdDevice;
/* Delay 200 ms to waiting for the FW ready */
if_usb_submit_rx_urb(cardp);