spin_lock_irqsave(&adapter->driver_lock, flags);
if (addtail) {
- list_add_tail((struct list_head *)cmdnode,
- &adapter->cmdpendingq);
+ list_add_tail(&cmdnode->list, &adapter->cmdpendingq);
adapter->nr_cmd_pending++;
} else
- list_add((struct list_head *)cmdnode, &adapter->cmdpendingq);
+ list_add(&cmdnode->list, &adapter->cmdpendingq);
spin_unlock_irqrestore(&adapter->driver_lock, flags);
return;
cleanup_cmdnode(ptempcmd);
- list_add_tail((struct list_head *)ptempcmd, &adapter->cmdfreeq);
+ list_add_tail(&ptempcmd->list, &adapter->cmdfreeq);
}
static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
spin_lock_irqsave(&adapter->driver_lock, flags);
if (!list_empty(&adapter->cmdfreeq)) {
- tempnode = (struct cmd_ctrl_node *)adapter->cmdfreeq.next;
- list_del((struct list_head *)tempnode);
+ tempnode = list_first_entry(&adapter->cmdfreeq,
+ struct cmd_ctrl_node, list);
+ list_del(&tempnode->list);
} else {
lbs_deb_host("GET_CMD_NODE: cmd_ctrl_node is not available\n");
tempnode = NULL;
}
if (!list_empty(&adapter->cmdpendingq)) {
- cmdnode = (struct cmd_ctrl_node *)
- adapter->cmdpendingq.next;
+ cmdnode = list_first_entry(&adapter->cmdpendingq,
+ struct cmd_ctrl_node, list);
}
spin_unlock_irqrestore(&adapter->driver_lock, flags);
cpu_to_le16(CMD_SUBCMD_EXIT_PS)) {
lbs_deb_host(
"EXEC_NEXT_CMD: ignore ENTER_PS cmd\n");
- list_del((struct list_head *)cmdnode);
+ list_del(&cmdnode->list);
lbs_cleanup_and_insert_cmd(priv, cmdnode);
ret = 0;
(adapter->psstate == PS_STATE_PRE_SLEEP)) {
lbs_deb_host(
"EXEC_NEXT_CMD: ignore EXIT_PS cmd in sleep\n");
- list_del((struct list_head *)cmdnode);
+ list_del(&cmdnode->list);
lbs_cleanup_and_insert_cmd(priv, cmdnode);
adapter->needtowakeup = 1;
"EXEC_NEXT_CMD: sending EXIT_PS\n");
}
}
- list_del((struct list_head *)cmdnode);
+ list_del(&cmdnode->list);
lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
le16_to_cpu(cmdptr->command));
DownloadcommandToStation(priv, cmdnode);