Skip to content

Commit

Permalink
s390/qeth: extract qeth_l2_remove_mac()
Browse files Browse the repository at this point in the history
This matches qeth_l2_write_mac().

Signed-off-by: Julian Wiedmann <[email protected]>
Reviewed-by: Thomas Richter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
julianwiedmann authored and davem330 committed Jan 12, 2017
1 parent 754e0b8 commit 979d792
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions drivers/s390/net/qeth_l2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,22 @@ static inline u32 qeth_l2_mac_hash(const u8 *addr)

static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)
{

int rc;

if (mac->is_uc) {
rc = qeth_l2_send_setdelmac(card, mac->mac_addr,
return qeth_l2_send_setdelmac(card, mac->mac_addr,
IPA_CMD_SETVMAC);
} else {
rc = qeth_l2_send_setgroupmac(card, mac->mac_addr);
return qeth_l2_send_setgroupmac(card, mac->mac_addr);
}
}

static int qeth_l2_remove_mac(struct qeth_card *card, struct qeth_mac *mac)
{
if (mac->is_uc) {
return qeth_l2_send_setdelmac(card, mac->mac_addr,
IPA_CMD_DELVMAC);
} else {
return qeth_l2_send_delgroupmac(card, mac->mac_addr);
}
return rc;
}

static void qeth_l2_del_all_macs(struct qeth_card *card)
Expand Down Expand Up @@ -782,14 +788,7 @@ static void qeth_l2_set_rx_mode(struct net_device *dev)

hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) {
if (mac->disp_flag == QETH_DISP_ADDR_DELETE) {
if (!mac->is_uc)
rc = qeth_l2_send_delgroupmac(card,
mac->mac_addr);
else {
rc = qeth_l2_send_setdelmac(card, mac->mac_addr,
IPA_CMD_DELVMAC);
}

qeth_l2_remove_mac(card, mac);
hash_del(&mac->hnode);
kfree(mac);

Expand Down

0 comments on commit 979d792

Please sign in to comment.