/* Interface control information */
-typedef struct dhd_if {
- struct dhd_info *info; /* back pointer to dhd_info */
+struct brcmf_if {
+ struct brcmf_info *info; /* back pointer to brcmf_info */
/* OS/stack specifics */
struct net_device *net;
struct net_device_stats stats;
bool attached; /* Delayed attachment when unset */
bool txflowcontrol; /* Per interface flow control indicator */
char name[IFNAMSIZ]; /* linux interface name */
-} dhd_if_t;
+};
/* Local private structure (extension of pub) */
-typedef struct dhd_info {
+struct brcmf_info {
dhd_pub_t pub;
/* OS/stack specifics */
- dhd_if_t *iflist[BRCMF_MAX_IFS];
+ struct brcmf_if *iflist[BRCMF_MAX_IFS];
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif /* CONFIG_HAS_EARLYSUSPEND */
-} dhd_info_t;
+};
/* Error bits */
module_param(brcmf_msg_level, int, 0);
#define DHD_COMPILED
#endif
-static int brcmf_toe_get(dhd_info_t *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_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
+static int brcmf_toe_get(struct brcmf_info *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(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
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;
static void brcmf_early_suspend(struct early_suspend *h)
{
- struct dhd_info *drvr_priv =
- container_of(h, struct dhd_info, early_suspend);
+ struct brcmf_info *drvr_priv =
+ container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
static void brcmf_late_resume(struct early_suspend *h)
{
- struct dhd_info *drvr_priv =
- container_of(h, struct dhd_info, early_suspend);
+ struct brcmf_info *drvr_priv =
+ container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
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;
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;
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);
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 netdev_hw_addr *ha;
}
}
-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];
struct brcmf_ioctl ioc;
extern struct net_device *ap_net_dev;
#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;
ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */
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;
#ifdef SOFTAP
bool in_ap = false;
{
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;
int ifidx;
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;
ifidx = brcmf_net2idx(drvr_priv, dev);
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 */
if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN))
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
{
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;
DHD_TRACE(("%s: Enter\n", __func__));
void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
{
struct net_device *net;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
DHD_TRACE(("%s: Enter\n", __func__));
void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
int numpkt)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
unsigned char *eth;
uint len;
void *data;
struct sk_buff *pnext, *save_pktbuf;
int i;
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
brcmf_event_msg_t event;
DHD_TRACE(("%s: Enter\n", __func__));
}
}
-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 */
return;
void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
{
uint ifidx;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
struct ethhdr *eh;
u16 type;
static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
- dhd_if_t *ifp;
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_if *ifp;
int ifidx;
DHD_TRACE(("%s: Enter\n", __func__));
/* Retrieve current toe component enables, which are kept
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;
char buf[32];
/* Set current toe component enables in toe_ol 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;
char buf[32];
static void brcmf_ethtool_get_drvinfo(struct net_device *net,
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->version, "%lu", drvr_priv->pub.drv_version);
.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;
char drvname[sizeof(info.driver)];
static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
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;
int bcmerror = 0;
int buflen = 0;
static int brcmf_netdev_stop(struct net_device *net)
{
#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__));
wl_cfg80211_down();
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;
int ifidx = brcmf_net2idx(drvr_priv, net);
s32 ret = 0;
}
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)
{
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
- ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC);
+ ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) {
- DHD_ERROR(("%s: OOM - dhd_if_t\n", __func__));
+ DHD_ERROR(("%s: OOM - struct dhd_if\n", __func__));
return -ENOMEM;
}
}
- memset(ifp, 0, sizeof(dhd_if_t));
+ memset(ifp, 0, sizeof(struct brcmf_if));
ifp->info = drvr_priv;
drvr_priv->iflist[ifidx] = ifp;
strlcpy(ifp->name, name, IFNAMSIZ);
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_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;
DHD_TRACE(("%s: Enter\n", __func__));
goto fail;
}
- /* Allocate primary dhd_info */
- drvr_priv = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC);
+ /* Allocate primary brcmf_info */
+ drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
if (!drvr_priv) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
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));
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));
int brcmf_bus_start(dhd_pub_t *drvr)
{
int ret = -1;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
/* Room for "event_msgs" + '\0' + bitvec */
char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
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;
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
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__));
void brcmf_detach(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv;
+ struct brcmf_info *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__));
if (drvr) {
drvr_priv = drvr->info;
if (drvr_priv) {
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
int i;
#if defined(CONFIG_HAS_EARLYSUSPEND)
*/
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) {
down(&drvr_priv->proto_sem);
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) {
up(&drvr_priv->proto_sem);
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);
int timeout = brcmf_ioctl_timeout_msec;
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))
wake_up_interruptible(&drvr_priv->ioctl_resp_wait);
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)
{
int bcmerror = 0;
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);
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;
if (drvr_priv) {
{
int ret = 0;
#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) {
brcmf_os_proto_block(&drvr_priv->pub);
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)
drvr_priv->pub.dtim_skip = 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;
/* Packet filtering is set only if we still in early-suspend and
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);
}
-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);
}
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 ntimes = MAX_WAIT_FOR_8021X_TX;
int pend = brcmf_get_pend_8021x_cnt(drvr_priv);