From e419d62d72b23392e7f9a5da047fb17d70edc54a Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Fri, 8 Jul 2011 08:46:14 -0700 Subject: iwlagn: consolidate the API that sends host commands and move to transport Now, there are only two functions to send a host command: * send_cmd that receives a iwl_host_cmd * send_cmd_pdu that builds the iwl_host_cmd itself and received flags The flags CMD_ASYNC / CMD_SYNC / CMD_WANT_SKB are not changed by the API functions. Kill the unused flags CMD_SIZE_NORMAL / CMD_NO_SKB on the way. Signed-off-by: Emmanuel Grumbach Signed-off-by: Wey-Yi Guy Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-dev.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 85e4fa35037..975ad79a5f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h @@ -259,10 +259,8 @@ struct iwl_channel_info { enum { CMD_SYNC = 0, - CMD_SIZE_NORMAL = 0, - CMD_NO_SKB = 0, - CMD_ASYNC = (1 << 1), - CMD_WANT_SKB = (1 << 2), + CMD_ASYNC = BIT(0), + CMD_WANT_SKB = BIT(1), }; #define DEF_CMD_PAYLOAD_SIZE 320 @@ -295,6 +293,16 @@ enum iwl_hcmd_dataflag { IWL_HCMD_DFL_NOCOPY = BIT(0), }; +/** + * struct iwl_host_cmd - Host command to the uCode + * @data: array of chunks that composes the data of the host command + * @reply_page: pointer to the page that holds the response to the host command + * @callback: + * @flags: can be CMD_* note CMD_WANT_SKB is incompatible withe CMD_ASYNC + * @len: array of the lenths of the chunks in data + * @dataflags: + * @id: id of the host command + */ struct iwl_host_cmd { const void *data[IWL_MAX_CMD_TFDS]; unsigned long reply_page; @@ -1234,6 +1242,8 @@ struct iwl_trans; * @tx_init:inits the tx memory, allocate if needed * @tx_stop: stop the tx * @tx_free: frees the tx memory + * @send_cmd:send a host command + * @send_cmd_pdu:send a host command: flags can be CMD_* */ struct iwl_trans_ops { int (*rx_init)(struct iwl_priv *priv); @@ -1243,6 +1253,11 @@ struct iwl_trans_ops { int (*tx_init)(struct iwl_priv *priv); int (*tx_stop)(struct iwl_priv *priv); void (*tx_free)(struct iwl_priv *priv); + + int (*send_cmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd); + + int (*send_cmd_pdu)(struct iwl_priv *priv, u8 id, u32 flags, u16 len, + const void *data); }; struct iwl_trans { -- cgit v1.2.2