Skip to content

Commit

Permalink
staging: brcm80211: replaced typedef antsel_info_t by struct antsel_info
Browse files Browse the repository at this point in the history
Code cleanup.

Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Dec 8, 2010
1 parent 0e49347 commit 299f8a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
32 changes: 17 additions & 15 deletions drivers/staging/brcm80211/sys/wlc_antsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
#define ANT_SELCFG_DEF_2x4 0x02 /* default antenna configuration */

/* static functions */
static int wlc_antsel_cfgupd(antsel_info_t *asi, wlc_antselcfg_t *antsel);
static u8 wlc_antsel_id2antcfg(antsel_info_t *asi, u8 id);
static u16 wlc_antsel_antcfg2antsel(antsel_info_t *asi, u8 ant_cfg);
static void wlc_antsel_init_cfg(antsel_info_t *asi, wlc_antselcfg_t *antsel,
static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel);
static u8 wlc_antsel_id2antcfg(struct antsel_info *asi, u8 id);
static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg);
static void wlc_antsel_init_cfg(struct antsel_info *asi,
wlc_antselcfg_t *antsel,
bool auto_sel);

const u16 mimo_2x4_div_antselpat_tbl[] = {
Expand All @@ -93,12 +94,13 @@ const u8 mimo_2x3_div_antselid_tbl[16] = {
0, 0, 0, 0, 0, 0, 0, 0 /* pat to antselid */
};

antsel_info_t *wlc_antsel_attach(struct wlc_info *wlc, struct osl_info *osh,
struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
struct osl_info *osh,
wlc_pub_t *pub,
struct wlc_hw_info *wlc_hw) {
antsel_info_t *asi;
struct antsel_info *asi;

asi = kzalloc(sizeof(antsel_info_t), GFP_ATOMIC);
asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
if (!asi) {
WL_ERROR(("wl%d: wlc_antsel_attach: out of mem\n", pub->unit));
return NULL;
Expand Down Expand Up @@ -157,15 +159,15 @@ antsel_info_t *wlc_antsel_attach(struct wlc_info *wlc, struct osl_info *osh,
return asi;
}

void wlc_antsel_detach(antsel_info_t *asi)
void wlc_antsel_detach(struct antsel_info *asi)
{
if (!asi)
return;

kfree(asi);
}

void wlc_antsel_init(antsel_info_t *asi)
void wlc_antsel_init(struct antsel_info *asi)
{
if ((asi->antsel_type == ANTSEL_2x3) ||
(asi->antsel_type == ANTSEL_2x4))
Expand All @@ -174,7 +176,7 @@ void wlc_antsel_init(antsel_info_t *asi)

/* boardlevel antenna selection: init antenna selection structure */
static void
wlc_antsel_init_cfg(antsel_info_t *asi, wlc_antselcfg_t *antsel,
wlc_antsel_init_cfg(struct antsel_info *asi, wlc_antselcfg_t *antsel,
bool auto_sel)
{
if (asi->antsel_type == ANTSEL_2x3) {
Expand Down Expand Up @@ -205,7 +207,7 @@ wlc_antsel_init_cfg(antsel_info_t *asi, wlc_antselcfg_t *antsel,
}

void BCMFASTPATH
wlc_antsel_antcfg_get(antsel_info_t *asi, bool usedef, bool sel,
wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
u8 antselid, u8 fbantselid, u8 *antcfg,
u8 *fbantcfg)
{
Expand Down Expand Up @@ -237,7 +239,7 @@ wlc_antsel_antcfg_get(antsel_info_t *asi, bool usedef, bool sel,
}

/* boardlevel antenna selection: convert mimo_antsel (ucode interface) to id */
u8 wlc_antsel_antsel2id(antsel_info_t *asi, u16 antsel)
u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel)
{
u8 antselid = 0;

Expand All @@ -256,7 +258,7 @@ u8 wlc_antsel_antsel2id(antsel_info_t *asi, u16 antsel)
}

/* boardlevel antenna selection: convert id to ant_cfg */
static u8 wlc_antsel_id2antcfg(antsel_info_t *asi, u8 id)
static u8 wlc_antsel_id2antcfg(struct antsel_info *asi, u8 id)
{
u8 antcfg = ANT_SELCFG_DEF_2x2;

Expand All @@ -275,7 +277,7 @@ static u8 wlc_antsel_id2antcfg(antsel_info_t *asi, u8 id)
}

/* boardlevel antenna selection: convert ant_cfg to mimo_antsel (ucode interface) */
static u16 wlc_antsel_antcfg2antsel(antsel_info_t *asi, u8 ant_cfg)
static u16 wlc_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
{
u8 idx = WLC_ANTIDX_11N(WLC_ANTSEL_11N(ant_cfg));
u16 mimo_antsel = 0;
Expand All @@ -295,7 +297,7 @@ static u16 wlc_antsel_antcfg2antsel(antsel_info_t *asi, u8 ant_cfg)
}

/* boardlevel antenna selection: ucode interface control */
static int wlc_antsel_cfgupd(antsel_info_t *asi, wlc_antselcfg_t *antsel)
static int wlc_antsel_cfgupd(struct antsel_info *asi, wlc_antselcfg_t *antsel)
{
struct wlc_info *wlc = asi->wlc;
u8 ant_cfg;
Expand Down
11 changes: 6 additions & 5 deletions drivers/staging/brcm80211/sys/wlc_antsel.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

#ifndef _wlc_antsel_h_
#define _wlc_antsel_h_
extern antsel_info_t *wlc_antsel_attach(struct wlc_info *wlc,
extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
struct osl_info *osh,
wlc_pub_t *pub,
struct wlc_hw_info *wlc_hw);
extern void wlc_antsel_detach(antsel_info_t *asi);
extern void wlc_antsel_init(antsel_info_t *asi);
extern void wlc_antsel_antcfg_get(antsel_info_t *asi, bool usedef, bool sel,
extern void wlc_antsel_detach(struct antsel_info *asi);
extern void wlc_antsel_init(struct antsel_info *asi);
extern void wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
bool sel,
u8 id, u8 fbid, u8 *antcfg,
u8 *fbantcfg);
extern u8 wlc_antsel_antsel2id(antsel_info_t *asi, u16 antsel);
extern u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
#endif /* _wlc_antsel_h_ */
7 changes: 5 additions & 2 deletions drivers/staging/brcm80211/sys/wlc_mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ struct wlc_hw_info {
u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic
* 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
*/
u32 antsel_avail; /* put antsel_info_t here if more info is needed */
u32 antsel_avail; /*
* put struct antsel_info here if more info is
* needed
*/
};

/* TX Queue information
Expand Down Expand Up @@ -549,7 +552,7 @@ struct wlc_info {


struct ampdu_info *ampdu; /* ampdu module handler */
antsel_info_t *asi; /* antsel module handler */
struct antsel_info *asi; /* antsel module handler */
wlc_cm_info_t *cmi; /* channel manager module handler */

void *btparam; /* bus type specific cookie */
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/brcm80211/sys/wlc_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct wlc_if;
typedef struct wl_if wl_if_t;
struct ampdu_info;
struct wlc_ap_info;
typedef struct antsel_info antsel_info_t;
struct antsel_info;
typedef struct bmac_pmq bmac_pmq_t;

struct d11init;
Expand Down

0 comments on commit 299f8a4

Please sign in to comment.