aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-12 16:00:42 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:02 -0500
commit689442dca16eb27fee19074499d42845fe54c12a (patch)
tree21346cef514f95ec2a842838dbe85bc09bef26fc /drivers/net
parent6ce4fd2a3a84e64a27c42aaa7de6e0e85dee3573 (diff)
libertas: switch lbs_cmd() to take a _pointer_ to the command structure
This way, it looks more like a normal function. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/libertas/cmd.c17
-rw-r--r--drivers/net/wireless/libertas/cmd.h10
-rw-r--r--drivers/net/wireless/libertas/if_usb.c2
3 files changed, 14 insertions, 15 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 2d7b646557c8..f87cecb4c579 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -56,7 +56,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
56 memset(&cmd, 0, sizeof(cmd)); 56 memset(&cmd, 0, sizeof(cmd));
57 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 57 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
58 memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN); 58 memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN);
59 ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, cmd); 59 ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, &cmd);
60 if (ret) 60 if (ret)
61 goto out; 61 goto out;
62 62
@@ -121,7 +121,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
121 cmd_config.gpio = gpio; 121 cmd_config.gpio = gpio;
122 cmd_config.gap = gap; 122 cmd_config.gap = gap;
123 123
124 ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, cmd_config); 124 ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, &cmd_config);
125 if (ret) { 125 if (ret) {
126 lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret); 126 lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret);
127 return ret; 127 return ret;
@@ -743,7 +743,7 @@ int lbs_get_data_rate(struct lbs_private *priv)
743 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 743 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
744 cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE); 744 cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE);
745 745
746 ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd); 746 ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
747 if (ret) 747 if (ret)
748 goto out; 748 goto out;
749 749
@@ -790,7 +790,7 @@ int lbs_set_data_rate(struct lbs_private *priv, u8 rate)
790 lbs_deb_cmd("DATA_RATE: setting auto\n"); 790 lbs_deb_cmd("DATA_RATE: setting auto\n");
791 } 791 }
792 792
793 ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd); 793 ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, &cmd);
794 if (ret) 794 if (ret)
795 goto out; 795 goto out;
796 796
@@ -846,7 +846,7 @@ int lbs_get_channel(struct lbs_private *priv)
846 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 846 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
847 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET); 847 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);
848 848
849 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd); 849 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd);
850 if (ret) 850 if (ret)
851 goto out; 851 goto out;
852 852
@@ -878,7 +878,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
878 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET); 878 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
879 cmd.channel = cpu_to_le16(channel); 879 cmd.channel = cpu_to_le16(channel);
880 880
881 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd); 881 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd);
882 if (ret) 882 if (ret)
883 goto out; 883 goto out;
884 884
@@ -1105,7 +1105,7 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t cmd_action,
1105 1105
1106 cmd->action = cpu_to_le16(cmd_action); 1106 cmd->action = cpu_to_le16(cmd_action);
1107 1107
1108 ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, (*cmd)); 1108 ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, cmd);
1109 1109
1110 lbs_deb_leave(LBS_DEB_CMD); 1110 lbs_deb_leave(LBS_DEB_CMD);
1111 return ret; 1111 return ret;
@@ -1128,7 +1128,7 @@ int lbs_mesh_config(struct lbs_private *priv, int enable)
1128 lbs_deb_cmd("mesh config channel %d SSID %s\n", 1128 lbs_deb_cmd("mesh config channel %d SSID %s\n",
1129 priv->curbssparams.channel, 1129 priv->curbssparams.channel,
1130 escape_essid(priv->mesh_ssid, priv->mesh_ssid_len)); 1130 escape_essid(priv->mesh_ssid, priv->mesh_ssid_len));
1131 return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd); 1131 return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, &cmd);
1132} 1132}
1133 1133
1134static int lbs_cmd_bcn_ctrl(struct lbs_private * priv, 1134static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
@@ -2160,6 +2160,7 @@ int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
2160 lbs_deb_leave(LBS_DEB_CMD); 2160 lbs_deb_leave(LBS_DEB_CMD);
2161 return 0; 2161 return 0;
2162} 2162}
2163EXPORT_SYMBOL_GPL(lbs_cmd_copyback);
2163 2164
2164/** 2165/**
2165 * @brief Simple way to call firmware functions 2166 * @brief Simple way to call firmware functions
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h
index 8d72c7e25250..e800295479ba 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -6,13 +6,11 @@
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, callback, callback_arg) \ 9#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg) \
10 __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd), \ 10 __lbs_cmd(priv, cmdnr, &(cmd)->hdr, sizeof(*(cmd)), cb, cb_arg)
11 callback, callback_arg)
12 11
13#define lbs_cmd_with_response(priv, cmdnr, cmd) \ 12#define lbs_cmd_with_response(priv, cmdnr, cmd) \
14 __lbs_cmd(priv, cmdnr, &(cmd).hdr, sizeof(cmd), \ 13 lbs_cmd(priv, cmdnr, cmd, lbs_cmd_copyback, (unsigned long) (cmd))
15 lbs_cmd_copyback, (unsigned long) &cmd)
16 14
17int __lbs_cmd(struct lbs_private *priv, uint16_t command, 15int __lbs_cmd(struct lbs_private *priv, uint16_t command,
18 struct cmd_header *in_cmd, int in_cmd_size, 16 struct cmd_header *in_cmd, int in_cmd_size,
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 3f8b83cc0d22..74fec9dfca07 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -109,7 +109,7 @@ static void if_usb_set_boot2_ver(struct lbs_private *priv)
109 b2_cmd.action = 0; 109 b2_cmd.action = 0;
110 b2_cmd.version = priv->boot2_version; 110 b2_cmd.version = priv->boot2_version;
111 111
112 if (lbs_cmd(priv, CMD_SET_BOOT2_VER, b2_cmd, NULL, 0)) 112 if (lbs_cmd(priv, CMD_SET_BOOT2_VER, &b2_cmd, NULL, 0))
113 lbs_deb_usb("Setting boot2 version failed\n"); 113 lbs_deb_usb("Setting boot2 version failed\n");
114} 114}
115 115