Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300954
b: refs/heads/master
c: 3625c14
h: refs/heads/master
v: v3
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Apr 13, 2012
1 parent d048a31 commit a397dc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 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: 75c49904c9dbacb83e36c3d770e86b78b0661cbb
refs/heads/master: 3625c149d60a70f039b34a45ddec67bbff4b7053
25 changes: 12 additions & 13 deletions trunk/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,27 +843,26 @@ static const struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_set_rx_mode = brcmf_netdev_set_multicast_list
};

static int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
static int brcmf_net_attach(struct brcmf_if *ifp)
{
struct brcmf_pub *drvr = ifp->drvr;
struct net_device *ndev;
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
u8 temp_addr[ETH_ALEN];

brcmf_dbg(TRACE, "ifidx %d\n", ifidx);
brcmf_dbg(TRACE, "ifidx %d\n", ifp->idx);

ndev = drvr->iflist[ifidx]->ndev;
ndev = drvr->iflist[ifp->idx]->ndev;
ndev->netdev_ops = &brcmf_netdev_ops_pri;

/*
* We have to use the primary MAC for virtual interfaces
* determine mac address to use
*/
if (ifidx != 0) {
/* for virtual interfaces use the primary MAC */
if (is_valid_ether_addr(ifp->mac_addr))
memcpy(temp_addr, ifp->mac_addr, ETH_ALEN);
else
memcpy(temp_addr, drvr->mac, ETH_ALEN);

}

if (ifidx == 1) {
if (ifp->idx == 1) {
brcmf_dbg(TRACE, "ACCESS POINT MAC:\n");
/* ACCESSPOINT INTERFACE CASE */
temp_addr[0] |= 0X02; /* set bit 2 ,
Expand All @@ -879,7 +878,7 @@ static int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
memcpy(ndev->dev_addr, temp_addr, ETH_ALEN);

/* attach to cfg80211 for primary interface */
if (!ifidx) {
if (!ifp->idx) {
drvr->config = brcmf_cfg80211_attach(ndev, drvr->dev, drvr);
if (drvr->config == NULL) {
brcmf_dbg(ERROR, "wl_cfg80211_attach failed\n");
Expand Down Expand Up @@ -940,7 +939,7 @@ brcmf_add_if(struct device *dev, int ifidx, char *name, u8 *mac_addr)
if (mac_addr != NULL)
memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);

if (brcmf_net_attach(drvr, ifp->idx)) {
if (brcmf_net_attach(ifp)) {
brcmf_dbg(ERROR, "brcmf_net_attach failed");
free_netdev(ifp->ndev);
drvr->iflist[ifidx] = NULL;
Expand Down

0 comments on commit a397dc5

Please sign in to comment.