diff options
| -rw-r--r-- | drivers/net/wireless/libertas/cmd.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h index 6efb81ec597e..b9ab85cc7913 100644 --- a/drivers/net/wireless/libertas/cmd.h +++ b/drivers/net/wireless/libertas/cmd.h | |||
| @@ -6,13 +6,15 @@ | |||
| 6 | #include "hostcmd.h" | 6 | #include "hostcmd.h" |
| 7 | #include "dev.h" | 7 | #include "dev.h" |
| 8 | 8 | ||
| 9 | #define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \ | 9 | /* lbs_cmd() infers the size of the buffer to copy data back into, from |
| 10 | __lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg) | 10 | the size of the target of the pointer. Since the command to be sent |
| 11 | may often be smaller, that size is set in cmd->size by the caller.*/ | ||
| 12 | #define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) ({ \ | ||
| 13 | uint16_t __sz = le16_to_cpu((cmd)->hdr.size); \ | ||
| 14 | (cmd)->hdr.size = cpu_to_le16(sizeof(*(cmd))); \ | ||
| 15 | __lbs_cmd(priv, cmdnr, &(cmd)->hdr, __sz, cb, cb_arg); \ | ||
| 16 | }) | ||
| 11 | 17 | ||
| 12 | |||
| 13 | /* lbs_cmd_with_response() infers the size of the command to be _sent_ | ||
| 14 | and requires that the caller sets cmd->size to the (LE) size of | ||
| 15 | the _response_ buffer. */ | ||
| 16 | #define lbs_cmd_with_response(priv, cmdnr, cmd) \ | 18 | #define lbs_cmd_with_response(priv, cmdnr, cmd) \ |
| 17 | lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd)) | 19 | lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd)) |
| 18 | 20 | ||
