diff options
author | Frank Blaschka <frank.blaschka@de.ibm.com> | 2008-08-15 02:02:59 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-08-27 05:55:27 -0400 |
commit | 7db2266a374d66f5ac85334c922cb37d76939cc5 (patch) | |
tree | 1bf60b07087d901deb6fef1fa8839febb1b47e7f /drivers | |
parent | 211cd45ac71dcd40d473fddf9a49cb1085173cb1 (diff) |
qeth: l2 write unicast list to hardware
In case the netdev unicast list contains additional entries we have
to register/deregister them.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 1 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 27 |
2 files changed, 23 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 80971c21ea1a..bf8a75c92f28 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -689,6 +689,7 @@ struct qeth_mc_mac { | |||
689 | struct list_head list; | 689 | struct list_head list; |
690 | __u8 mc_addr[MAX_ADDR_LEN]; | 690 | __u8 mc_addr[MAX_ADDR_LEN]; |
691 | unsigned char mc_addrlen; | 691 | unsigned char mc_addrlen; |
692 | int is_vmac; | ||
692 | }; | 693 | }; |
693 | 694 | ||
694 | struct qeth_card { | 695 | struct qeth_card { |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index b3cee032f578..3ac3cc1e03cc 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -177,9 +177,10 @@ static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac) | |||
177 | qeth_l2_send_delgroupmac_cb); | 177 | qeth_l2_send_delgroupmac_cb); |
178 | } | 178 | } |
179 | 179 | ||
180 | static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac) | 180 | static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac, int vmac) |
181 | { | 181 | { |
182 | struct qeth_mc_mac *mc; | 182 | struct qeth_mc_mac *mc; |
183 | int rc; | ||
183 | 184 | ||
184 | mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC); | 185 | mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC); |
185 | 186 | ||
@@ -188,8 +189,16 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac) | |||
188 | 189 | ||
189 | memcpy(mc->mc_addr, mac, OSA_ADDR_LEN); | 190 | memcpy(mc->mc_addr, mac, OSA_ADDR_LEN); |
190 | mc->mc_addrlen = OSA_ADDR_LEN; | 191 | mc->mc_addrlen = OSA_ADDR_LEN; |
192 | mc->is_vmac = vmac; | ||
193 | |||
194 | if (vmac) { | ||
195 | rc = qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETVMAC, | ||
196 | NULL); | ||
197 | } else { | ||
198 | rc = qeth_l2_send_setgroupmac(card, mac); | ||
199 | } | ||
191 | 200 | ||
192 | if (!qeth_l2_send_setgroupmac(card, mac)) | 201 | if (!rc) |
193 | list_add_tail(&mc->list, &card->mc_list); | 202 | list_add_tail(&mc->list, &card->mc_list); |
194 | else | 203 | else |
195 | kfree(mc); | 204 | kfree(mc); |
@@ -201,7 +210,11 @@ static void qeth_l2_del_all_mc(struct qeth_card *card) | |||
201 | 210 | ||
202 | spin_lock_bh(&card->mclock); | 211 | spin_lock_bh(&card->mclock); |
203 | list_for_each_entry_safe(mc, tmp, &card->mc_list, list) { | 212 | list_for_each_entry_safe(mc, tmp, &card->mc_list, list) { |
204 | qeth_l2_send_delgroupmac(card, mc->mc_addr); | 213 | if (mc->is_vmac) |
214 | qeth_l2_send_setdelmac(card, mc->mc_addr, | ||
215 | IPA_CMD_DELVMAC, NULL); | ||
216 | else | ||
217 | qeth_l2_send_delgroupmac(card, mc->mc_addr); | ||
205 | list_del(&mc->list); | 218 | list_del(&mc->list); |
206 | kfree(mc); | 219 | kfree(mc); |
207 | } | 220 | } |
@@ -590,7 +603,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) | |||
590 | static void qeth_l2_set_multicast_list(struct net_device *dev) | 603 | static void qeth_l2_set_multicast_list(struct net_device *dev) |
591 | { | 604 | { |
592 | struct qeth_card *card = dev->ml_priv; | 605 | struct qeth_card *card = dev->ml_priv; |
593 | struct dev_mc_list *dm; | 606 | struct dev_addr_list *dm; |
594 | 607 | ||
595 | if (card->info.type == QETH_CARD_TYPE_OSN) | 608 | if (card->info.type == QETH_CARD_TYPE_OSN) |
596 | return ; | 609 | return ; |
@@ -599,7 +612,11 @@ static void qeth_l2_set_multicast_list(struct net_device *dev) | |||
599 | qeth_l2_del_all_mc(card); | 612 | qeth_l2_del_all_mc(card); |
600 | spin_lock_bh(&card->mclock); | 613 | spin_lock_bh(&card->mclock); |
601 | for (dm = dev->mc_list; dm; dm = dm->next) | 614 | for (dm = dev->mc_list; dm; dm = dm->next) |
602 | qeth_l2_add_mc(card, dm->dmi_addr); | 615 | qeth_l2_add_mc(card, dm->da_addr, 0); |
616 | |||
617 | for (dm = dev->uc_list; dm; dm = dm->next) | ||
618 | qeth_l2_add_mc(card, dm->da_addr, 1); | ||
619 | |||
603 | spin_unlock_bh(&card->mclock); | 620 | spin_unlock_bh(&card->mclock); |
604 | if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) | 621 | if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) |
605 | return; | 622 | return; |