net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
Let caller know the result of adding/removing vlan id to/from vlan filter. In some drivers I make those functions to just return 0. But in those where there is able to see if hw setup went correctly, return value is set appropriately. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
7da82c06de
commit
8e586137e6
@@ -301,21 +301,21 @@ static void qeth_l2_process_vlans(struct qeth_card *card)
|
||||
spin_unlock_bh(&card->vlanlock);
|
||||
}
|
||||
|
||||
static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
|
||||
static int qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
|
||||
{
|
||||
struct qeth_card *card = dev->ml_priv;
|
||||
struct qeth_vlan_vid *id;
|
||||
|
||||
QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
|
||||
if (!vid)
|
||||
return;
|
||||
return 0;
|
||||
if (card->info.type == QETH_CARD_TYPE_OSM) {
|
||||
QETH_CARD_TEXT(card, 3, "aidOSM");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
|
||||
QETH_CARD_TEXT(card, 3, "aidREC");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC);
|
||||
if (id) {
|
||||
@@ -324,10 +324,13 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
|
||||
spin_lock_bh(&card->vlanlock);
|
||||
list_add_tail(&id->list, &card->vid_list);
|
||||
spin_unlock_bh(&card->vlanlock);
|
||||
} else {
|
||||
return -ENOMEM;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
||||
static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
||||
{
|
||||
struct qeth_vlan_vid *id, *tmpid = NULL;
|
||||
struct qeth_card *card = dev->ml_priv;
|
||||
@@ -335,11 +338,11 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
||||
QETH_CARD_TEXT_(card, 4, "kid:%d", vid);
|
||||
if (card->info.type == QETH_CARD_TYPE_OSM) {
|
||||
QETH_CARD_TEXT(card, 3, "kidOSM");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
|
||||
QETH_CARD_TEXT(card, 3, "kidREC");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
spin_lock_bh(&card->vlanlock);
|
||||
list_for_each_entry(id, &card->vid_list, list) {
|
||||
@@ -355,6 +358,7 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
|
||||
kfree(tmpid);
|
||||
}
|
||||
qeth_l2_set_multicast_list(card->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
|
||||
|
Reference in New Issue
Block a user