From: Andrzej Pietrasiewicz Date: Tue, 28 May 2013 07:15:45 +0000 (+0200) Subject: usb: gadget: u_ether: allow getting binary-form host address X-Git-Tag: firefly_0821_release~176^2~5847^2~60^2~22 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bf4277c73adc3a6b244deab34a3906b9418b9d5e;p=firefly-linux-kernel-4.4.55.git usb: gadget: u_ether: allow getting binary-form host address helper function to copy MAC address to proper place. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Kyungmin Park Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 6d3ccdc09e1e..2aae0d61bb19 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -963,6 +963,15 @@ int gether_get_host_addr_cdc(struct net_device *net, char *host_addr, int len) } EXPORT_SYMBOL(gether_get_host_addr_cdc); +void gether_get_host_addr_u8(struct net_device *net, u8 host_mac[ETH_ALEN]) +{ + struct eth_dev *dev; + + dev = netdev_priv(net); + memcpy(host_mac, dev->host_mac, ETH_ALEN); +} +EXPORT_SYMBOL(gether_get_host_addr_u8); + void gether_set_qmult(struct net_device *net, unsigned qmult) { struct eth_dev *dev; diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h index 1671a7963d01..5efa657cf469 100644 --- a/drivers/usb/gadget/u_ether.h +++ b/drivers/usb/gadget/u_ether.h @@ -209,6 +209,16 @@ int gether_get_host_addr(struct net_device *net, char *host_addr, int len); */ int gether_get_host_addr_cdc(struct net_device *net, char *host_addr, int len); +/** + * gether_get_host_addr_u8 - get an ethernet-over-usb link host address + * @net: device representing this link + * @host_mac: place to store the eth address of the host + * + * This gets the binary formatted host-side Ethernet address of this + * ethernet-over-usb link. + */ +void gether_get_host_addr_u8(struct net_device *net, u8 host_mac[ETH_ALEN]); + /** * gether_set_qmult - initialize an ethernet-over-usb link with a multiplier * @net: device representing this link