Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90297
b: refs/heads/master
c: e98a88d
h: refs/heads/master
i:
  90295: c604166
v: v3
  • Loading branch information
Holger Schurig authored and John W. Linville committed Mar 25, 2008
1 parent 391af5c commit a8c2049
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 135 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4ff0ef635b222d5f66dad65e9364d702e5f94e0
refs/heads/master: e98a88dd33b7188ce84533e128101dd9630ae592
16 changes: 7 additions & 9 deletions trunk/drivers/net/wireless/libertas/11d.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static u8 *lbs_code_2_region(u8 code)
* @param nrchan number of channels
* @return the nrchan-th chan number
*/
static u8 lbs_get_chan_11d(u8 band, u8 firstchan, u8 nrchan, u8 *chan)
static u8 lbs_get_chan_11d(u8 firstchan, u8 nrchan, u8 *chan)
/*find the nrchan-th chan after the firstchan*/
{
u8 i;
Expand Down Expand Up @@ -134,7 +134,7 @@ static u8 lbs_channel_known_11d(u8 chan,
return 0;
}

u32 lbs_chan_2_freq(u8 chan, u8 band)
u32 lbs_chan_2_freq(u8 chan)
{
struct chan_freq_power *cf;
u16 i;
Expand Down Expand Up @@ -264,7 +264,7 @@ static void lbs_generate_parsed_region_chan_11d(struct region_channel *region_ch
* @param chan chan
* @return TRUE;FALSE
*/
static u8 lbs_region_chan_supported_11d(u8 region, u8 band, u8 chan)
static u8 lbs_region_chan_supported_11d(u8 region, u8 chan)
{
struct chan_freq_power *cfp;
int cfp_no;
Expand All @@ -273,7 +273,7 @@ static u8 lbs_region_chan_supported_11d(u8 region, u8 band, u8 chan)

lbs_deb_enter(LBS_DEB_11D);

cfp = lbs_get_region_cfp_table(region, band, &cfp_no);
cfp = lbs_get_region_cfp_table(region, &cfp_no);
if (cfp == NULL)
return 0;

Expand Down Expand Up @@ -367,16 +367,15 @@ static int parse_domain_info_11d(struct ieeetypes_countryinfofullset*
for (i = 0; idx < MAX_NO_OF_CHAN && i < nrchan; i++) {
/*step4: channel is supported? */

if (!lbs_get_chan_11d(band, firstchan, i, &curchan)) {
if (!lbs_get_chan_11d(firstchan, i, &curchan)) {
/* Chan is not found in UN table */
lbs_deb_11d("chan is not supported: %d \n", i);
break;
}

lastchan = curchan;

if (lbs_region_chan_supported_11d
(region, band, curchan)) {
if (lbs_region_chan_supported_11d(region, curchan)) {
/*step5: Check if curchan is supported by mrvl in region */
parsed_region_chan->chanpwr[idx].chan = curchan;
parsed_region_chan->chanpwr[idx].pwr =
Expand Down Expand Up @@ -554,8 +553,7 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
* @param resp pointer to command response buffer
* @return 0; -1
*/
int lbs_ret_802_11d_domain_info(struct lbs_private *priv,
struct cmd_ds_command *resp)
int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp)
{
struct cmd_ds_802_11d_domain_info *domaininfo = &resp->params.domaininforesp;
struct mrvlietypes_domainparamset *domain = &domaininfo->domain;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/wireless/libertas/11d.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct lbs_private;
u8 lbs_get_scan_type_11d(u8 chan,
struct parsed_region_chan_11d *parsed_region_chan);

u32 lbs_chan_2_freq(u8 chan, u8 band);
u32 lbs_chan_2_freq(u8 chan);

void lbs_init_11d(struct lbs_private *priv);

Expand All @@ -93,8 +93,7 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
struct cmd_ds_command *cmd, u16 cmdno,
u16 cmdOption);

int lbs_ret_802_11d_domain_info(struct lbs_private *priv,
struct cmd_ds_command *resp);
int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);

struct bss_descriptor;
int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
Expand Down
99 changes: 21 additions & 78 deletions trunk/drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include "cmd.h"

static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv);
static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
void *pdata_buf);


/**
Expand Down Expand Up @@ -183,8 +180,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria)
}
EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg);

static int lbs_cmd_802_11_ps_mode(struct lbs_private *priv,
struct cmd_ds_command *cmd,
static int lbs_cmd_802_11_ps_mode(struct cmd_ds_command *cmd,
u16 cmd_action)
{
struct cmd_ds_802_11_ps_mode *psm = &cmd->params.psmode;
Expand Down Expand Up @@ -479,8 +475,7 @@ int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
return ret;
}

static int lbs_cmd_802_11_reset(struct lbs_private *priv,
struct cmd_ds_command *cmd, int cmd_action)
static int lbs_cmd_802_11_reset(struct cmd_ds_command *cmd, int cmd_action)
{
struct cmd_ds_802_11_reset *reset = &cmd->params.reset;

Expand All @@ -494,18 +489,6 @@ static int lbs_cmd_802_11_reset(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_802_11_get_stat(struct lbs_private *priv,
struct cmd_ds_command *cmd)
{
lbs_deb_enter(LBS_DEB_CMD);
cmd->command = cpu_to_le16(CMD_802_11_GET_STAT);
cmd->size =
cpu_to_le16(sizeof(struct cmd_ds_802_11_get_stat) + S_DS_GEN);

lbs_deb_leave(LBS_DEB_CMD);
return 0;
}

static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
struct cmd_ds_command *cmd,
int cmd_action,
Expand Down Expand Up @@ -626,8 +609,7 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_802_11_rf_tx_power(struct lbs_private *priv,
struct cmd_ds_command *cmd,
static int lbs_cmd_802_11_rf_tx_power(struct cmd_ds_command *cmd,
u16 cmd_action, void *pdata_buf)
{

Expand Down Expand Up @@ -670,8 +652,7 @@ static int lbs_cmd_802_11_rf_tx_power(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_802_11_monitor_mode(struct lbs_private *priv,
struct cmd_ds_command *cmd,
static int lbs_cmd_802_11_monitor_mode(struct cmd_ds_command *cmd,
u16 cmd_action, void *pdata_buf)
{
struct cmd_ds_802_11_monitor_mode *monitor = &cmd->params.monitor;
Expand Down Expand Up @@ -898,8 +879,7 @@ static int lbs_cmd_802_11_rssi(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_reg_access(struct lbs_private *priv,
struct cmd_ds_command *cmdptr,
static int lbs_cmd_reg_access(struct cmd_ds_command *cmdptr,
u8 cmd_action, void *pdata_buf)
{
struct lbs_offset_value *offval;
Expand Down Expand Up @@ -996,9 +976,8 @@ static int lbs_cmd_802_11_mac_address(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_802_11_eeprom_access(struct lbs_private *priv,
struct cmd_ds_command *cmd,
int cmd_action, void *pdata_buf)
static int lbs_cmd_802_11_eeprom_access(struct cmd_ds_command *cmd,
void *pdata_buf)
{
struct lbs_ioctl_regrdwr *ea = pdata_buf;

Expand All @@ -1018,8 +997,7 @@ static int lbs_cmd_802_11_eeprom_access(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_bt_access(struct lbs_private *priv,
struct cmd_ds_command *cmd,
static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
u16 cmd_action, void *pdata_buf)
{
struct cmd_ds_bt_access *bt_access = &cmd->params.bt;
Expand Down Expand Up @@ -1056,8 +1034,7 @@ static int lbs_cmd_bt_access(struct lbs_private *priv,
return 0;
}

static int lbs_cmd_fwt_access(struct lbs_private *priv,
struct cmd_ds_command *cmd,
static int lbs_cmd_fwt_access(struct cmd_ds_command *cmd,
u16 cmd_action, void *pdata_buf)
{
struct cmd_ds_fwt_access *fwt_access = &cmd->params.fwt;
Expand Down Expand Up @@ -1376,7 +1353,8 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
goto done;
}

lbs_set_cmd_ctrl_node(priv, cmdnode, pdata_buf);
cmdnode->callback = NULL;
cmdnode->callback_arg = (unsigned long)pdata_buf;

cmdptr = (struct cmd_ds_command *)cmdnode->cmdbuf;

Expand All @@ -1391,7 +1369,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,

switch (cmd_no) {
case CMD_802_11_PS_MODE:
ret = lbs_cmd_802_11_ps_mode(priv, cmdptr, cmd_action);
ret = lbs_cmd_802_11_ps_mode(cmdptr, cmd_action);
break;

case CMD_802_11_ASSOCIATE:
Expand All @@ -1408,17 +1386,13 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
break;

case CMD_802_11_RESET:
ret = lbs_cmd_802_11_reset(priv, cmdptr, cmd_action);
ret = lbs_cmd_802_11_reset(cmdptr, cmd_action);
break;

case CMD_802_11_AUTHENTICATE:
ret = lbs_cmd_80211_authenticate(priv, cmdptr, pdata_buf);
break;

case CMD_802_11_GET_STAT:
ret = lbs_cmd_802_11_get_stat(priv, cmdptr);
break;

case CMD_802_11_SNMP_MIB:
ret = lbs_cmd_802_11_snmp_mib(priv, cmdptr,
cmd_action, cmd_oid, pdata_buf);
Expand All @@ -1427,12 +1401,12 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
case CMD_MAC_REG_ACCESS:
case CMD_BBP_REG_ACCESS:
case CMD_RF_REG_ACCESS:
ret = lbs_cmd_reg_access(priv, cmdptr, cmd_action, pdata_buf);
ret = lbs_cmd_reg_access(cmdptr, cmd_action, pdata_buf);
break;

case CMD_802_11_RF_TX_POWER:
ret = lbs_cmd_802_11_rf_tx_power(priv, cmdptr,
cmd_action, pdata_buf);
ret = lbs_cmd_802_11_rf_tx_power(cmdptr,
cmd_action, pdata_buf);
break;

case CMD_802_11_RATE_ADAPT_RATESET:
Expand All @@ -1445,7 +1419,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
break;

case CMD_802_11_MONITOR_MODE:
ret = lbs_cmd_802_11_monitor_mode(priv, cmdptr,
ret = lbs_cmd_802_11_monitor_mode(cmdptr,
cmd_action, pdata_buf);
break;

Expand All @@ -1458,16 +1432,15 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
break;

case CMD_802_11_AD_HOC_STOP:
ret = lbs_cmd_80211_ad_hoc_stop(priv, cmdptr);
ret = lbs_cmd_80211_ad_hoc_stop(cmdptr);
break;

case CMD_802_11_MAC_ADDRESS:
ret = lbs_cmd_802_11_mac_address(priv, cmdptr, cmd_action);
break;

case CMD_802_11_EEPROM_ACCESS:
ret = lbs_cmd_802_11_eeprom_access(priv, cmdptr,
cmd_action, pdata_buf);
ret = lbs_cmd_802_11_eeprom_access(cmdptr, pdata_buf);
break;

case CMD_802_11_SET_AFC:
Expand Down Expand Up @@ -1534,11 +1507,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
ret = 0;
break;
case CMD_BT_ACCESS:
ret = lbs_cmd_bt_access(priv, cmdptr, cmd_action, pdata_buf);
ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
break;

case CMD_FWT_ACCESS:
ret = lbs_cmd_fwt_access(priv, cmdptr, cmd_action, pdata_buf);
ret = lbs_cmd_fwt_access(cmdptr, cmd_action, pdata_buf);
break;

case CMD_GET_TSF:
Expand Down Expand Up @@ -1710,36 +1683,6 @@ static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv)
return tempnode;
}

/**
* @brief This function cleans command node.
*
* @param ptempnode A pointer to cmdCtrlNode structure
* @return n/a
*/

/**
* @brief This function initializes the command node.
*
* @param priv A pointer to struct lbs_private structure
* @param ptempnode A pointer to cmd_ctrl_node structure
* @param pdata_buf A pointer to informaion buffer
* @return 0 or -1
*/
static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
void *pdata_buf)
{
lbs_deb_enter(LBS_DEB_HOST);

if (!ptempnode)
return;

ptempnode->callback = NULL;
ptempnode->callback_arg = (unsigned long)pdata_buf;

lbs_deb_leave(LBS_DEB_HOST);
}

/**
* @brief This function executes next command in command
* pending queue. It will put fimware back to PS mode
Expand Down
Loading

0 comments on commit a8c2049

Please sign in to comment.