Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268484
b: refs/heads/master
c: 66b9aa0
h: refs/heads/master
v: v3
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Sep 16, 2011
1 parent c4fbf9c commit 5375e10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 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: 5a8dc2ef78b790854bf67fb688a84e293f70deba
refs/heads/master: 66b9aa024583d31684f184d804d6d55b00392f31
28 changes: 7 additions & 21 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ struct brcmf_info {
/* Error bits */
module_param(brcmf_msg_level, int, 0);

/* Network inteface name */
char iface_name[IFNAMSIZ] = "wlan";
module_param_string(iface_name, iface_name, IFNAMSIZ, 0);

static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
{
Expand Down Expand Up @@ -311,10 +308,11 @@ static void brcmf_op_if(struct brcmf_if *ifp)
unregister_netdev(ifp->net);
free_netdev(ifp->net);
}
/* Allocate etherdev, including space for private structure */
ifp->net = alloc_etherdev(sizeof(drvr_priv));
/* Allocate netdev, including space for private structure */
ifp->net = alloc_netdev(sizeof(drvr_priv), "wlan%d",
ether_setup);
if (!ifp->net) {
brcmf_dbg(ERROR, "OOM - alloc_etherdev\n");
brcmf_dbg(ERROR, "OOM - alloc_netdev\n");
ret = -ENOMEM;
}
if (ret == 0) {
Expand Down Expand Up @@ -1009,10 +1007,10 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)

brcmf_dbg(TRACE, "Enter\n");

/* Allocate etherdev, including space for private structure */
net = alloc_etherdev(sizeof(drvr_priv));
/* Allocate netdev, including space for private structure */
net = alloc_netdev(sizeof(drvr_priv), "wlan%d", ether_setup);
if (!net) {
brcmf_dbg(ERROR, "OOM - alloc_etherdev\n");
brcmf_dbg(ERROR, "OOM - alloc_netdev\n");
goto fail;
}

Expand All @@ -1028,18 +1026,6 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
*/
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));

/* Set network interface name if it was provided as module parameter */
if (iface_name[0]) {
int len;
char ch;
strncpy(net->name, iface_name, IFNAMSIZ);
net->name[IFNAMSIZ - 1] = 0;
len = strlen(net->name);
ch = net->name[len - 1];
if ((ch > '9' || ch < '0') && (len < IFNAMSIZ - 2))
strcat(net->name, "%d");
}

if (brcmf_add_if(drvr_priv, 0, net, net->name, NULL, 0, 0) ==
BRCMF_BAD_IF)
goto fail;
Expand Down

0 comments on commit 5375e10

Please sign in to comment.