mirror of
https://github.com/ipxe/ipxe
synced 2026-01-02 18:03:36 +03:00
[ncm] Support setting MAC address
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -453,6 +453,15 @@ static int ncm_open ( struct net_device *netdev ) {
|
|||||||
goto err_set_ntb_input_size;
|
goto err_set_ntb_input_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set MAC address */
|
||||||
|
if ( ( rc = usb_control ( usb, NCM_SET_NET_ADDRESS, 0,
|
||||||
|
ncm->usbnet.comms, netdev->ll_addr,
|
||||||
|
netdev->ll_protocol->ll_addr_len ) ) != 0 ) {
|
||||||
|
DBGC ( ncm, "NCM %p could not set MAC address: %s\n",
|
||||||
|
ncm, strerror ( rc ) );
|
||||||
|
/* Ignore error and continue */
|
||||||
|
}
|
||||||
|
|
||||||
/* Open USB network device */
|
/* Open USB network device */
|
||||||
if ( ( rc = usbnet_open ( &ncm->usbnet ) ) != 0 ) {
|
if ( ( rc = usbnet_open ( &ncm->usbnet ) ) != 0 ) {
|
||||||
DBGC ( ncm, "NCM %p could not open: %s\n",
|
DBGC ( ncm, "NCM %p could not open: %s\n",
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ struct ncm_ntb_parameters {
|
|||||||
uint16_t max;
|
uint16_t max;
|
||||||
} __attribute__ (( packed ));
|
} __attribute__ (( packed ));
|
||||||
|
|
||||||
|
/** Set MAC address */
|
||||||
|
#define NCM_SET_NET_ADDRESS \
|
||||||
|
( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
|
||||||
|
USB_REQUEST_TYPE ( 0x82 ) )
|
||||||
|
|
||||||
/** Set NTB input size */
|
/** Set NTB input size */
|
||||||
#define NCM_SET_NTB_INPUT_SIZE \
|
#define NCM_SET_NTB_INPUT_SIZE \
|
||||||
( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
|
( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
|
||||||
|
|||||||
Reference in New Issue
Block a user