Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362660
b: refs/heads/master
c: cc6ba5f
h: refs/heads/master
v: v3
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Apr 19, 2013
1 parent 2cfd8ff commit 593a1f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6483bdc9d76fb98174797516a19d289eb837909e
refs/heads/master: cc6ba5fdaabea7a7b28de3ba1e0fe54d92232fe5
9 changes: 9 additions & 0 deletions trunk/drivers/net/usb/qmi_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ struct qmi_wwan_state {
struct usb_interface *data;
};

/* default ethernet address used by the modem */
static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};

/* Make up an ethernet header if the packet doesn't have one.
*
* A firmware bug common among several devices cause them to send raw
Expand Down Expand Up @@ -317,6 +320,12 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
usb_driver_release_interface(driver, info->data);
}

/* Never use the same address on both ends of the link, even
* if the buggy firmware told us to.
*/
if (!compare_ether_addr(dev->net->dev_addr, default_modem_addr))
eth_hw_addr_random(dev->net);

/* make MAC addr easily distinguishable from an IP header */
if (possibly_iphdr(dev->net->dev_addr)) {
dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */
Expand Down

0 comments on commit 593a1f8

Please sign in to comment.