Added ec_device_id_print().
This commit is contained in:
parent
27f9a4af2d
commit
046d9e7cd5
|
|
@ -197,3 +197,26 @@ int ec_device_id_check(const ec_device_id_t *dev_id,
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
ssize_t ec_device_id_print(const ec_device_id_t *dev_id, char *buffer)
|
||||
{
|
||||
off_t off = 0;
|
||||
unsigned int i;
|
||||
|
||||
switch (dev_id->type) {
|
||||
case ec_device_id_empty:
|
||||
off += sprintf(buffer + off, "none");
|
||||
break;
|
||||
case ec_device_id_mac:
|
||||
off += sprintf(buffer + off, "MAC ");
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
off += sprintf(buffer + off, "%02X", dev_id->octets[i]);
|
||||
if (i < ETH_ALEN - 1) off += sprintf(buffer + off, ":");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return off;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ int ec_device_id_process_params(const char *, const char *,
|
|||
void ec_device_id_clear_list(struct list_head *);
|
||||
int ec_device_id_check(const ec_device_id_t *, const struct net_device *,
|
||||
const char *, unsigned int);
|
||||
ssize_t ec_device_id_print(const ec_device_id_t *, char *);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue