Commit abfe1804 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: rename structure definitions in dhd_linux.c

renamed structures to consitent naming convention and removed the
structure type definitions.
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bb26354a
...@@ -524,14 +524,14 @@ struct brcmf_ioctl { ...@@ -524,14 +524,14 @@ struct brcmf_ioctl {
/* Forward decls for struct dhd_pub (see below) */ /* Forward decls for struct dhd_pub (see below) */
struct dhd_bus; /* device bus info */ struct dhd_bus; /* device bus info */
struct brcmf_proto; /* device communication protocol info */ struct brcmf_proto; /* device communication protocol info */
struct dhd_info; /* device driver info */ struct brcmf_info; /* device driver info */
/* Common structure for module and instance linkage */ /* Common structure for module and instance linkage */
typedef struct dhd_pub { typedef struct dhd_pub {
/* Linkage ponters */ /* Linkage ponters */
struct dhd_bus *bus; struct dhd_bus *bus;
struct brcmf_proto *prot; struct brcmf_proto *prot;
struct dhd_info *info; struct brcmf_info *info;
/* Internal dhd items */ /* Internal dhd items */
bool up; /* Driver up/down (to OS) */ bool up; /* Driver up/down (to OS) */
...@@ -806,22 +806,22 @@ extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size); ...@@ -806,22 +806,22 @@ extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec); extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
extern int brcmf_timeout_expired(struct brcmf_timeout *tmo); extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name); extern int brcmf_ifname2idx(struct brcmf_info *dhd, char *name);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata, extern int brcmf_c_host_event(struct brcmf_info *dhd, int *idx, void *pktdata,
brcmf_event_msg_t *, void **data_ptr); brcmf_event_msg_t *, void **data_ptr);
extern void brcmf_c_init(void); extern void brcmf_c_init(void);
extern int brcmf_add_if(struct dhd_info *dhd, int ifidx, void *handle, extern int brcmf_add_if(struct brcmf_info *dhd, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx); char *name, u8 *mac_addr, u32 flags, u8 bssidx);
extern void brcmf_del_if(struct dhd_info *dhd, int ifidx); extern void brcmf_del_if(struct brcmf_info *dhd, int ifidx);
extern void brcmf_vif_add(struct dhd_info *dhd, int ifidx, char *name); extern void brcmf_vif_add(struct brcmf_info *dhd, int ifidx, char *name);
extern void brcmf_vif_del(struct dhd_info *dhd, int ifidx); extern void brcmf_vif_del(struct brcmf_info *dhd, int ifidx);
extern void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen, extern void brcmf_event(struct brcmf_info *dhd, char *evpkt, int evlen,
int ifidx); int ifidx);
extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx, extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
unsigned char *cp, int len); unsigned char *cp, int len);
/* Send packet to dongle via data channel */ /* Send packet to dongle via data channel */
......
...@@ -755,8 +755,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data) ...@@ -755,8 +755,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
#endif /* SHOW_EVENTS */ #endif /* SHOW_EVENTS */
int int
brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata, brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data_ptr) brcmf_event_msg_t *event, void **data_ptr)
{ {
/* check whether packet is a BRCM event pkt */ /* check whether packet is a BRCM event pkt */
brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata; brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
......
...@@ -60,8 +60,8 @@ MODULE_LICENSE("Dual BSD/GPL"); ...@@ -60,8 +60,8 @@ MODULE_LICENSE("Dual BSD/GPL");
/* Interface control information */ /* Interface control information */
typedef struct dhd_if { struct brcmf_if {
struct dhd_info *info; /* back pointer to dhd_info */ struct brcmf_info *info; /* back pointer to brcmf_info */
/* OS/stack specifics */ /* OS/stack specifics */
struct net_device *net; struct net_device *net;
struct net_device_stats stats; struct net_device_stats stats;
...@@ -72,14 +72,14 @@ typedef struct dhd_if { ...@@ -72,14 +72,14 @@ typedef struct dhd_if {
bool attached; /* Delayed attachment when unset */ bool attached; /* Delayed attachment when unset */
bool txflowcontrol; /* Per interface flow control indicator */ bool txflowcontrol; /* Per interface flow control indicator */
char name[IFNAMSIZ]; /* linux interface name */ char name[IFNAMSIZ]; /* linux interface name */
} dhd_if_t; };
/* Local private structure (extension of pub) */ /* Local private structure (extension of pub) */
typedef struct dhd_info { struct brcmf_info {
dhd_pub_t pub; dhd_pub_t pub;
/* OS/stack specifics */ /* OS/stack specifics */
dhd_if_t *iflist[BRCMF_MAX_IFS]; struct brcmf_if *iflist[BRCMF_MAX_IFS];
struct semaphore proto_sem; struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait; wait_queue_head_t ioctl_resp_wait;
...@@ -95,7 +95,7 @@ typedef struct dhd_info { ...@@ -95,7 +95,7 @@ typedef struct dhd_info {
#ifdef CONFIG_HAS_EARLYSUSPEND #ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend; struct early_suspend early_suspend;
#endif /* CONFIG_HAS_EARLYSUSPEND */ #endif /* CONFIG_HAS_EARLYSUSPEND */
} dhd_info_t; };
/* Error bits */ /* Error bits */
module_param(brcmf_msg_level, int, 0); module_param(brcmf_msg_level, int, 0);
...@@ -182,9 +182,9 @@ module_param(brcmf_pktgen_len, uint, 0); ...@@ -182,9 +182,9 @@ module_param(brcmf_pktgen_len, uint, 0);
#define DHD_COMPILED #define DHD_COMPILED
#endif #endif
static int brcmf_toe_get(dhd_info_t *drvr_priv, int idx, u32 *toe_ol); static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
static int brcmf_toe_set(dhd_info_t *drvr_priv, int idx, u32 toe_ol); static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata, static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr); brcmf_event_msg_t *event_ptr, void **data_ptr);
static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr) static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
...@@ -271,7 +271,7 @@ static int brcmf_set_suspend(int value, dhd_pub_t *drvr) ...@@ -271,7 +271,7 @@ static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
return 0; return 0;
} }
static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val) static void brcmf_suspend_resume_helper(struct brcmf_info *drvr_priv, int val)
{ {
dhd_pub_t *drvr = &drvr_priv->pub; dhd_pub_t *drvr = &drvr_priv->pub;
...@@ -285,8 +285,8 @@ static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val) ...@@ -285,8 +285,8 @@ static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val)
static void brcmf_early_suspend(struct early_suspend *h) static void brcmf_early_suspend(struct early_suspend *h)
{ {
struct dhd_info *drvr_priv = struct brcmf_info *drvr_priv =
container_of(h, struct dhd_info, early_suspend); container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__)); DHD_TRACE(("%s: enter\n", __func__));
...@@ -297,8 +297,8 @@ static void brcmf_early_suspend(struct early_suspend *h) ...@@ -297,8 +297,8 @@ static void brcmf_early_suspend(struct early_suspend *h)
static void brcmf_late_resume(struct early_suspend *h) static void brcmf_late_resume(struct early_suspend *h)
{ {
struct dhd_info *drvr_priv = struct brcmf_info *drvr_priv =
container_of(h, struct dhd_info, early_suspend); container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__)); DHD_TRACE(("%s: enter\n", __func__));
...@@ -365,7 +365,7 @@ int brcmf_timeout_expired(struct brcmf_timeout *tmo) ...@@ -365,7 +365,7 @@ int brcmf_timeout_expired(struct brcmf_timeout *tmo)
return 0; return 0;
} }
static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net) static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
{ {
int i = 0; int i = 0;
...@@ -379,7 +379,7 @@ static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net) ...@@ -379,7 +379,7 @@ static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net)
return BRCMF_BAD_IF; return BRCMF_BAD_IF;
} }
int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name) int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
{ {
int i = BRCMF_MAX_IFS; int i = BRCMF_MAX_IFS;
...@@ -400,7 +400,7 @@ int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name) ...@@ -400,7 +400,7 @@ int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name)
char *brcmf_ifname(dhd_pub_t *drvr, int ifidx) char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
ASSERT(drvr_priv); ASSERT(drvr_priv);
...@@ -420,7 +420,7 @@ char *brcmf_ifname(dhd_pub_t *drvr, int ifidx) ...@@ -420,7 +420,7 @@ char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
return "<if_none>"; return "<if_none>";
} }
static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx) static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
{ {
struct net_device *dev; struct net_device *dev;
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
...@@ -536,7 +536,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx) ...@@ -536,7 +536,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
} }
} }
static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr) static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr)
{ {
char buf[32]; char buf[32];
struct brcmf_ioctl ioc; struct brcmf_ioctl ioc;
...@@ -570,9 +570,9 @@ static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr) ...@@ -570,9 +570,9 @@ static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
extern struct net_device *ap_net_dev; extern struct net_device *ap_net_dev;
#endif #endif
static void brcmf_op_if(dhd_if_t *ifp) static void brcmf_op_if(struct brcmf_if *ifp)
{ {
dhd_info_t *drvr_priv; struct brcmf_info *drvr_priv;
int ret = 0, err = 0; int ret = 0, err = 0;
ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */ ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */
...@@ -662,7 +662,7 @@ static void brcmf_op_if(dhd_if_t *ifp) ...@@ -662,7 +662,7 @@ static void brcmf_op_if(dhd_if_t *ifp)
static int _brcmf_sysioc_thread(void *data) static int _brcmf_sysioc_thread(void *data)
{ {
dhd_info_t *drvr_priv = (dhd_info_t *) data; struct brcmf_info *drvr_priv = (struct brcmf_info *) data;
int i; int i;
#ifdef SOFTAP #ifdef SOFTAP
bool in_ap = false; bool in_ap = false;
...@@ -723,7 +723,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr) ...@@ -723,7 +723,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
{ {
int ret = 0; int ret = 0;
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)addr; struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx; int ifidx;
...@@ -741,7 +741,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr) ...@@ -741,7 +741,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
static void brcmf_netdev_set_multicast_list(struct net_device *dev) static void brcmf_netdev_set_multicast_list(struct net_device *dev)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
int ifidx; int ifidx;
ifidx = brcmf_net2idx(drvr_priv, dev); ifidx = brcmf_net2idx(drvr_priv, dev);
...@@ -755,7 +755,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev) ...@@ -755,7 +755,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf) int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
/* Reject if down */ /* Reject if down */
if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN)) if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN))
...@@ -782,7 +782,7 @@ int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf) ...@@ -782,7 +782,7 @@ int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net) static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
{ {
int ret; int ret;
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
int ifidx; int ifidx;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -835,7 +835,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net) ...@@ -835,7 +835,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state) void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
{ {
struct net_device *net; struct net_device *net;
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -851,13 +851,13 @@ void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state) ...@@ -851,13 +851,13 @@ void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb, void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
int numpkt) int numpkt)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
unsigned char *eth; unsigned char *eth;
uint len; uint len;
void *data; void *data;
struct sk_buff *pnext, *save_pktbuf; struct sk_buff *pnext, *save_pktbuf;
int i; int i;
dhd_if_t *ifp; struct brcmf_if *ifp;
brcmf_event_msg_t event; brcmf_event_msg_t event;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -932,7 +932,7 @@ void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb, ...@@ -932,7 +932,7 @@ void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
} }
} }
void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx) void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen, int ifidx)
{ {
/* Linux version has nothing to do */ /* Linux version has nothing to do */
return; return;
...@@ -941,7 +941,7 @@ void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx) ...@@ -941,7 +941,7 @@ void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx)
void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success) void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
{ {
uint ifidx; uint ifidx;
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
struct ethhdr *eh; struct ethhdr *eh;
u16 type; u16 type;
...@@ -957,8 +957,8 @@ void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success) ...@@ -957,8 +957,8 @@ void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net) static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
dhd_if_t *ifp; struct brcmf_if *ifp;
int ifidx; int ifidx;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -991,7 +991,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net) ...@@ -991,7 +991,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
/* Retrieve current toe component enables, which are kept /* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */ as a bitmap in toe_ol iovar */
static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol) static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
{ {
struct brcmf_ioctl ioc; struct brcmf_ioctl ioc;
char buf[32]; char buf[32];
...@@ -1025,7 +1025,7 @@ static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol) ...@@ -1025,7 +1025,7 @@ static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
/* Set current toe component enables in toe_ol iovar, /* Set current toe component enables in toe_ol iovar,
and set toe global enable iovar */ and set toe global enable iovar */
static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol) static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
{ {
struct brcmf_ioctl ioc; struct brcmf_ioctl ioc;
char buf[32]; char buf[32];
...@@ -1070,7 +1070,7 @@ static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol) ...@@ -1070,7 +1070,7 @@ static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
static void brcmf_ethtool_get_drvinfo(struct net_device *net, static void brcmf_ethtool_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info) struct ethtool_drvinfo *info)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
sprintf(info->driver, KBUILD_MODNAME); sprintf(info->driver, KBUILD_MODNAME);
sprintf(info->version, "%lu", drvr_priv->pub.drv_version); sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
...@@ -1082,7 +1082,7 @@ struct ethtool_ops brcmf_ethtool_ops = { ...@@ -1082,7 +1082,7 @@ struct ethtool_ops brcmf_ethtool_ops = {
.get_drvinfo = brcmf_ethtool_get_drvinfo .get_drvinfo = brcmf_ethtool_get_drvinfo
}; };
static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr) static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
{ {
struct ethtool_drvinfo info; struct ethtool_drvinfo info;
char drvname[sizeof(info.driver)]; char drvname[sizeof(info.driver)];
...@@ -1196,7 +1196,7 @@ static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr) ...@@ -1196,7 +1196,7 @@ static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr)
static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr, static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int cmd) int cmd)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
struct brcmf_c_ioctl ioc; struct brcmf_c_ioctl ioc;
int bcmerror = 0; int bcmerror = 0;
int buflen = 0; int buflen = 0;
...@@ -1312,7 +1312,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr, ...@@ -1312,7 +1312,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
static int brcmf_netdev_stop(struct net_device *net) static int brcmf_netdev_stop(struct net_device *net)
{ {
#if !defined(IGNORE_ETH0_DOWN) #if !defined(IGNORE_ETH0_DOWN)
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
wl_cfg80211_down(); wl_cfg80211_down();
...@@ -1332,7 +1332,7 @@ static int brcmf_netdev_stop(struct net_device *net) ...@@ -1332,7 +1332,7 @@ static int brcmf_netdev_stop(struct net_device *net)
static int brcmf_netdev_open(struct net_device *net) static int brcmf_netdev_open(struct net_device *net)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
u32 toe_ol; u32 toe_ol;
int ifidx = brcmf_net2idx(drvr_priv, net); int ifidx = brcmf_net2idx(drvr_priv, net);
s32 ret = 0; s32 ret = 0;
...@@ -1371,10 +1371,10 @@ static int brcmf_netdev_open(struct net_device *net) ...@@ -1371,10 +1371,10 @@ static int brcmf_netdev_open(struct net_device *net)
} }
int int
brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name, brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
u8 *mac_addr, u32 flags, u8 bssidx) u8 *mac_addr, u32 flags, u8 bssidx)
{ {
dhd_if_t *ifp; struct brcmf_if *ifp;
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle)); DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
...@@ -1382,14 +1382,14 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name, ...@@ -1382,14 +1382,14 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
ifp = drvr_priv->iflist[ifidx]; ifp = drvr_priv->iflist[ifidx];
if (!ifp) { if (!ifp) {
ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC); ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) { if (!ifp) {
DHD_ERROR(("%s: OOM - dhd_if_t\n", __func__)); DHD_ERROR(("%s: OOM - struct dhd_if\n", __func__));
return -ENOMEM; return -ENOMEM;
} }
} }
memset(ifp, 0, sizeof(dhd_if_t)); memset(ifp, 0, sizeof(struct brcmf_if));
ifp->info = drvr_priv; ifp->info = drvr_priv;
drvr_priv->iflist[ifidx] = ifp; drvr_priv->iflist[ifidx] = ifp;
strlcpy(ifp->name, name, IFNAMSIZ); strlcpy(ifp->name, name, IFNAMSIZ);
...@@ -1407,9 +1407,9 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name, ...@@ -1407,9 +1407,9 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
return 0; return 0;
} }
void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx) void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
{ {
dhd_if_t *ifp; struct brcmf_if *ifp;
DHD_TRACE(("%s: idx %d\n", __func__, ifidx)); DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
...@@ -1428,7 +1428,7 @@ void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx) ...@@ -1428,7 +1428,7 @@ void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx)
dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen) dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
{ {
dhd_info_t *drvr_priv = NULL; struct brcmf_info *drvr_priv = NULL;
struct net_device *net; struct net_device *net;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -1440,15 +1440,15 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen) ...@@ -1440,15 +1440,15 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
goto fail; goto fail;
} }
/* Allocate primary dhd_info */ /* Allocate primary brcmf_info */
drvr_priv = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC); drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
if (!drvr_priv) { if (!drvr_priv) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__)); DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
goto fail; goto fail;
} }
/* /*
* Save the dhd_info into the priv * Save the brcmf_info into the priv
*/ */
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv)); memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
...@@ -1505,7 +1505,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen) ...@@ -1505,7 +1505,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
drvr_priv->sysioc_tsk = NULL; drvr_priv->sysioc_tsk = NULL;
/* /*
* Save the dhd_info into the priv * Save the brcmf_info into the priv
*/ */
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv)); memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
...@@ -1538,7 +1538,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen) ...@@ -1538,7 +1538,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
int brcmf_bus_start(dhd_pub_t *drvr) int brcmf_bus_start(dhd_pub_t *drvr)
{ {
int ret = -1; int ret = -1;
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
/* Room for "event_msgs" + '\0' + bitvec */ /* Room for "event_msgs" + '\0' + bitvec */
char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
...@@ -1635,7 +1635,7 @@ static struct net_device_ops brcmf_netdev_ops_pri = { ...@@ -1635,7 +1635,7 @@ static struct net_device_ops brcmf_netdev_ops_pri = {
int brcmf_net_attach(dhd_pub_t *drvr, int ifidx) int brcmf_net_attach(dhd_pub_t *drvr, int ifidx)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
struct net_device *net; struct net_device *net;
u8 temp_addr[ETH_ALEN] = { u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33}; 0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
...@@ -1691,7 +1691,7 @@ int brcmf_net_attach(dhd_pub_t *drvr, int ifidx) ...@@ -1691,7 +1691,7 @@ int brcmf_net_attach(dhd_pub_t *drvr, int ifidx)
static void brcmf_bus_detach(dhd_pub_t *drvr) static void brcmf_bus_detach(dhd_pub_t *drvr)
{ {
dhd_info_t *drvr_priv; struct brcmf_info *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -1709,14 +1709,14 @@ static void brcmf_bus_detach(dhd_pub_t *drvr) ...@@ -1709,14 +1709,14 @@ static void brcmf_bus_detach(dhd_pub_t *drvr)
void brcmf_detach(dhd_pub_t *drvr) void brcmf_detach(dhd_pub_t *drvr)
{ {
dhd_info_t *drvr_priv; struct brcmf_info *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
if (drvr) { if (drvr) {
drvr_priv = drvr->info; drvr_priv = drvr->info;
if (drvr_priv) { if (drvr_priv) {
dhd_if_t *ifp; struct brcmf_if *ifp;
int i; int i;
#if defined(CONFIG_HAS_EARLYSUSPEND) #if defined(CONFIG_HAS_EARLYSUSPEND)
...@@ -1790,7 +1790,7 @@ module_exit(brcmf_module_cleanup); ...@@ -1790,7 +1790,7 @@ module_exit(brcmf_module_cleanup);
*/ */
int brcmf_os_proto_block(dhd_pub_t *drvr) int brcmf_os_proto_block(dhd_pub_t *drvr)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
if (drvr_priv) { if (drvr_priv) {
down(&drvr_priv->proto_sem); down(&drvr_priv->proto_sem);
...@@ -1801,7 +1801,7 @@ int brcmf_os_proto_block(dhd_pub_t *drvr) ...@@ -1801,7 +1801,7 @@ int brcmf_os_proto_block(dhd_pub_t *drvr)
int brcmf_os_proto_unblock(dhd_pub_t *drvr) int brcmf_os_proto_unblock(dhd_pub_t *drvr)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
if (drvr_priv) { if (drvr_priv) {
up(&drvr_priv->proto_sem); up(&drvr_priv->proto_sem);
...@@ -1823,7 +1823,7 @@ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec) ...@@ -1823,7 +1823,7 @@ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending) int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int timeout = brcmf_ioctl_timeout_msec; int timeout = brcmf_ioctl_timeout_msec;
...@@ -1848,7 +1848,7 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending) ...@@ -1848,7 +1848,7 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr) int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
{ {
dhd_info_t *drvr_priv = drvr->info; struct brcmf_info *drvr_priv = drvr->info;
if (waitqueue_active(&drvr_priv->ioctl_resp_wait)) if (waitqueue_active(&drvr_priv->ioctl_resp_wait))
wake_up_interruptible(&drvr_priv->ioctl_resp_wait); wake_up_interruptible(&drvr_priv->ioctl_resp_wait);
...@@ -1856,7 +1856,7 @@ int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr) ...@@ -1856,7 +1856,7 @@ int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
return 0; return 0;
} }
static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata, static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data) brcmf_event_msg_t *event, void **data)
{ {
int bcmerror = 0; int bcmerror = 0;
...@@ -1877,7 +1877,7 @@ static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata, ...@@ -1877,7 +1877,7 @@ static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
int brcmf_netdev_reset(struct net_device *dev, u8 flag) int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
brcmf_bus_devreset(&drvr_priv->pub, flag); brcmf_bus_devreset(&drvr_priv->pub, flag);
...@@ -1886,7 +1886,7 @@ int brcmf_netdev_reset(struct net_device *dev, u8 flag) ...@@ -1886,7 +1886,7 @@ int brcmf_netdev_reset(struct net_device *dev, u8 flag)
int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val) int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
int ret = 0; int ret = 0;
if (drvr_priv) { if (drvr_priv) {
...@@ -1900,7 +1900,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val) ...@@ -1900,7 +1900,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
{ {
int ret = 0; int ret = 0;
#if defined(CONFIG_HAS_EARLYSUSPEND) #if defined(CONFIG_HAS_EARLYSUSPEND)
dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
if (drvr_priv) { if (drvr_priv) {
brcmf_os_proto_block(&drvr_priv->pub); brcmf_os_proto_block(&drvr_priv->pub);
...@@ -1913,7 +1913,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val) ...@@ -1913,7 +1913,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val) int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
if (drvr_priv) if (drvr_priv)
drvr_priv->pub.dtim_skip = val; drvr_priv->pub.dtim_skip = val;
...@@ -1923,7 +1923,7 @@ int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val) ...@@ -1923,7 +1923,7 @@ int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
int brcmf_netdev_set_packet_filter(struct net_device *dev, int val) int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
int ret = 0; int ret = 0;
/* Packet filtering is set only if we still in early-suspend and /* Packet filtering is set only if we still in early-suspend and
...@@ -1944,12 +1944,12 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val) ...@@ -1944,12 +1944,12 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
void brcmf_netdev_init_ioctl(struct net_device *dev) void brcmf_netdev_init_ioctl(struct net_device *dev)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
brcmf_c_preinit_ioctls(&drvr_priv->pub); brcmf_c_preinit_ioctls(&drvr_priv->pub);
} }
static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv) static int brcmf_get_pend_8021x_cnt(struct brcmf_info *drvr_priv)
{ {
return atomic_read(&drvr_priv->pend_8021x_cnt); return atomic_read(&drvr_priv->pend_8021x_cnt);
} }
...@@ -1958,7 +1958,7 @@ static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv) ...@@ -1958,7 +1958,7 @@ static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv)
int brcmf_netdev_wait_pend8021x(struct net_device *dev) int brcmf_netdev_wait_pend8021x(struct net_device *dev)
{ {
dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev); struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
int timeout = 10 * HZ / 1000; int timeout = 10 * HZ / 1000;
int ntimes = MAX_WAIT_FOR_8021X_TX; int ntimes = MAX_WAIT_FOR_8021X_TX;
int pend = brcmf_get_pend_8021x_cnt(drvr_priv); int pend = brcmf_get_pend_8021x_cnt(drvr_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment