Skip to content

Commit

Permalink
staging: brcm80211: rename struct dhd_pub to struct brcmf_pub
Browse files Browse the repository at this point in the history
The structure dhd_pub has been renamed to have more consistent naming
in the fullmac driver. This also remove the type definition for this
structure.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent abfe180 commit fb1d0aa
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 119 deletions.
71 changes: 36 additions & 35 deletions drivers/staging/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,13 @@ struct brcmf_ioctl {
uint needed; /* bytes needed (optional) */
};

/* Forward decls for struct dhd_pub (see below) */
/* Forward decls for struct brcmf_pub (see below) */
struct dhd_bus; /* device bus info */
struct brcmf_proto; /* device communication protocol info */
struct brcmf_info; /* device driver info */

/* Common structure for module and instance linkage */
typedef struct dhd_pub {
struct brcmf_pub {
/* Linkage ponters */
struct dhd_bus *bus;
struct brcmf_proto *prot;
Expand Down Expand Up @@ -593,7 +593,7 @@ typedef struct dhd_pub {
u8 country_code[WLC_CNTRY_BUF_SZ];
char eventmask[BRCMF_EVENTING_MASK_LEN];

} dhd_pub_t;
};

struct brcmf_if_event {
u8 ifidx;
Expand Down Expand Up @@ -708,27 +708,27 @@ extern const bcmevent_name_t bcmevent_names[];
extern const int bcmevent_names_size;


static inline void MUTEX_LOCK_INIT(dhd_pub_t *dhdp)
static inline void MUTEX_LOCK_INIT(struct brcmf_pub *dhdp)
{
}

static inline void MUTEX_LOCK(dhd_pub_t *dhdp)
static inline void MUTEX_LOCK(struct brcmf_pub *dhdp)
{
}

static inline void MUTEX_UNLOCK(dhd_pub_t *dhdp)
static inline void MUTEX_UNLOCK(struct brcmf_pub *dhdp)
{
}

static inline void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t *dhdp)
static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *dhdp)
{
}

static inline void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t *dhdp)
static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
{
}

static inline void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t *dhdp)
static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
{
}

Expand All @@ -749,58 +749,58 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
*/

/* Indication from bus module regarding presence/insertion of dongle.
* Return dhd_pub_t pointer, used as handle to OS module in later calls.
* Return struct brcmf_pub pointer, used as handle to OS module in later calls.
* Returned structure should have bus and prot pointers filled in.
* bus_hdrlen specifies required headroom for bus module header.
*/
extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
uint bus_hdrlen);
extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);
extern int brcmf_net_attach(struct brcmf_pub *dhdp, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);

/* Indication from bus module regarding removal/absence of dongle */
extern void brcmf_detach(dhd_pub_t *dhdp);
extern void brcmf_detach(struct brcmf_pub *dhdp);

/* Indication from bus module to change flow-control state */
extern void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
extern void brcmf_txflowcontrol(struct brcmf_pub *dhdp, int ifidx, bool on);

extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
extern bool brcmf_c_prec_enq(struct brcmf_pub *dhdp, struct pktq *q,
struct sk_buff *pkt, int prec);

/* Receive frame for delivery to OS. Callee disposes of rxp. */
extern void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx,
extern void brcmf_rx_frame(struct brcmf_pub *dhdp, int ifidx,
struct sk_buff *rxp, int numpkt);

/* Return pointer to interface name */
extern char *brcmf_ifname(dhd_pub_t *dhdp, int idx);
extern char *brcmf_ifname(struct brcmf_pub *dhdp, int idx);

/* Request scheduling of the bus dpc */
extern void brcmf_sched_dpc(dhd_pub_t *dhdp);
extern void brcmf_sched_dpc(struct brcmf_pub *dhdp);

/* Notify tx completion */
extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
extern void brcmf_txcomplete(struct brcmf_pub *dhdp, struct sk_buff *txp,
bool success);

/* Query ioctl */
extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
void *buf, uint len);
extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx,
uint cmd, void *buf, uint len);

/* OS independent layer functions */
extern int brcmf_os_proto_block(dhd_pub_t *pub);
extern int brcmf_os_proto_unblock(dhd_pub_t *pub);
extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
extern int brcmf_os_proto_block(struct brcmf_pub *pub);
extern int brcmf_os_proto_unblock(struct brcmf_pub *pub);
extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *pub, uint *condition,
bool *pending);
extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *pub);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *pub);
extern void brcmf_os_sdlock_eventq(struct brcmf_pub *pub);
extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *pub);
#ifdef BCMDBG
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
extern int brcmf_write_to_file(struct brcmf_pub *dhd, u8 *buf, int size);
#endif /* BCMDBG */

extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
Expand All @@ -825,13 +825,14 @@ extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
unsigned char *cp, int len);

/* Send packet to dongle via data channel */
extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
extern int brcmf_sendpkt(struct brcmf_pub *dhdp, int ifidx,\
struct sk_buff *pkt);

extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern int brcmf_bus_start(dhd_pub_t *dhdp);
extern int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag);
extern int brcmf_bus_start(struct brcmf_pub *dhdp);

extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
extern void brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg,
extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *dhd, char *arg);
extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *dhd, char *arg,
int enable, int master_mode);

#ifdef BCMDBG
Expand Down
9 changes: 5 additions & 4 deletions drivers/staging/brcm80211/brcmfmac/dhd_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern void dhd_bus_unregister(void);
extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);

/* Initialize bus module: prepare for communication w/dongle */
extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex);

/* Send a data frame to the dongle. Callee disposes of txp. */
extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
Expand All @@ -58,15 +58,16 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);

/* Check for and handle local prot-specific iovar commands */
extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
void *params, int plen, void *arg, int len,
bool set);

/* Add bus dump output to a buffer */
extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp,
struct brcmu_strbuf *strbuf);

/* Clear any bus counters */
extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
extern void dhd_bus_clearcounts(struct brcmf_pub *dhdp);

/* return the dongle chipid */
extern uint dhd_bus_chip(struct dhd_bus *bus);
Expand Down
34 changes: 18 additions & 16 deletions drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct brcmf_proto {
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
};

static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
static int brcmf_proto_cdc_msg(struct brcmf_pub *dhd)
{
struct brcmf_proto *prot = dhd->prot;
int len = le32_to_cpu(prot->msg.len) +
Expand All @@ -120,7 +120,7 @@ static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
len);
}

static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
static int brcmf_proto_cdc_cmplt(struct brcmf_pub *dhd, u32 id, u32 len)
{
int ret;
struct brcmf_proto *prot = dhd->prot;
Expand All @@ -139,8 +139,8 @@ static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
}

int
brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len)
brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
void *buf, uint len)
{
struct brcmf_proto *prot = dhd->prot;
struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
Expand Down Expand Up @@ -221,7 +221,7 @@ brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
return ret;
}

int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
void *buf, uint len)
{
struct brcmf_proto *prot = dhd->prot;
Expand Down Expand Up @@ -275,8 +275,8 @@ int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,

extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
int len)
brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
void *buf, int len)
{
struct brcmf_proto *prot = dhd->prot;
int ret = -1;
Expand Down Expand Up @@ -356,18 +356,19 @@ brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
skb->ip_summed is overloaded */

int
brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
return -ENOTSUPP;
}

void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
void brcmf_proto_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
{
brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}

void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
void brcmf_proto_hdrpush(struct brcmf_pub *dhd, int ifidx,
struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;

Expand All @@ -389,7 +390,8 @@ void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
BDC_SET_IF_IDX(h, ifidx);
}

int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;

Expand Down Expand Up @@ -433,7 +435,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
return 0;
}

int brcmf_proto_attach(dhd_pub_t *dhd)
int brcmf_proto_attach(struct brcmf_pub *dhd)
{
struct brcmf_proto *cdc;

Expand Down Expand Up @@ -461,13 +463,13 @@ int brcmf_proto_attach(dhd_pub_t *dhd)
}

/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
void brcmf_proto_detach(dhd_pub_t *dhd)
void brcmf_proto_detach(struct brcmf_pub *dhd)
{
kfree(dhd->prot);
dhd->prot = NULL;
}

void brcmf_proto_dstats(dhd_pub_t *dhd)
void brcmf_proto_dstats(struct brcmf_pub *dhd)
{
/* No stats from dongle added yet, copy bus stats */
dhd->dstats.tx_packets = dhd->tx_packets;
Expand All @@ -479,7 +481,7 @@ void brcmf_proto_dstats(dhd_pub_t *dhd)
return;
}

int brcmf_proto_init(dhd_pub_t *dhd)
int brcmf_proto_init(struct brcmf_pub *dhd)
{
int ret = 0;
char buf[128];
Expand Down Expand Up @@ -508,7 +510,7 @@ int brcmf_proto_init(dhd_pub_t *dhd)
return ret;
}

void brcmf_proto_stop(dhd_pub_t *dhd)
void brcmf_proto_stop(struct brcmf_pub *dhd)
{
/* Nothing to do for CDC */
}
Loading

0 comments on commit fb1d0aa

Please sign in to comment.