|
@@ -61,10 +61,18 @@ struct setting chip_setting __setting ( SETTING_NETDEV ) = {
|
61
|
61
|
*/
|
62
|
62
|
static int netdev_store_mac ( struct net_device *netdev,
|
63
|
63
|
const void *data, size_t len ) {
|
|
64
|
+ struct ll_protocol *ll_protocol = netdev->ll_protocol;
|
|
65
|
+
|
|
66
|
+ /* Record new MAC address */
|
|
67
|
+ if ( data ) {
|
|
68
|
+ if ( len != netdev->ll_protocol->ll_addr_len )
|
|
69
|
+ return -EINVAL;
|
|
70
|
+ memcpy ( netdev->ll_addr, data, len );
|
|
71
|
+ } else {
|
|
72
|
+ /* Reset MAC address if clearing setting */
|
|
73
|
+ ll_protocol->init_addr ( netdev->hw_addr, netdev->ll_addr );
|
|
74
|
+ }
|
64
|
75
|
|
65
|
|
- if ( len != netdev->ll_protocol->ll_addr_len )
|
66
|
|
- return -EINVAL;
|
67
|
|
- memcpy ( netdev->ll_addr, data, len );
|
68
|
76
|
return 0;
|
69
|
77
|
}
|
70
|
78
|
|