Skip to contentSkip to conversation

s390: qeth fixes for 2.6.27

PATCH In review [email protected] 2 participants 5 messages Aug 15, 2008 – Aug 27, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover s390: qeth fixes for 2.6.27

Hi Jeff,

here are some qeth fixes for 2.6.27

shortlog:
Ursula Braun (1)
qeth: use -EOPNOTSUPP instead of -ENOTSUPP.

Frank Blaschka (2)
qeth: l2 write unicast list to hardware
qeth: preallocated header account offset

Thanks,
Frank

#1 lore raw

PATCH 1/3 qeth: use -EOPNOTSUPP instead of -ENOTSUPP.

From: Ursula Braun <[email protected]>

return value -ENOTSUPP is not valid in userspace context, use -EOPNOTSUPP instead.

---

 drivers/s390/net/qeth_l3_sys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_l3_sys.c +1 -1
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_sys.c linux-2.6-patched/drivers/s390/net/qeth_l3_sys.c
@@ -136,7 +136,7 @@ static ssize_t qeth_l3_dev_route6_store(
 		return -EINVAL;
 
 	if (!qeth_is_supported(card, IPA_IPV6)) {
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 	}
 
 	return qeth_l3_dev_route_store(card, &card->options.route6,
#2 lore raw

PATCH 2/3 qeth: l2 write unicast list to hardware

In reply to [email protected]

From: Frank Blaschka <[email protected]>

In case the netdev unicast list contains additional entries we have to register/deregister them.

---

 drivers/s390/net/qeth_core.h    |    1 +
 drivers/s390/net/qeth_l2_main.c |   27 ++++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)
drivers/s390/net/qeth_core.h +1 -0
Index: git_linus/drivers/s390/net/qeth_core.h
===================================================================
@@ -689,6 +689,7 @@
 	struct list_head list;
 	__u8 mc_addr[MAX_ADDR_LEN];
 	unsigned char mc_addrlen;
+	int is_vmac;
 };
 
 struct qeth_card {
drivers/s390/net/qeth_l2_main.c +22 -5
Index: git_linus/drivers/s390/net/qeth_l2_main.c
===================================================================
@@ -177,9 +177,10 @@
 					  qeth_l2_send_delgroupmac_cb);
 }
 
-static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac)
+static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac, int vmac)
 {
 	struct qeth_mc_mac *mc;
+	int rc;
 
 	mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC);
 
@@ -188,8 +189,16 @@
 
 	memcpy(mc->mc_addr, mac, OSA_ADDR_LEN);
 	mc->mc_addrlen = OSA_ADDR_LEN;
+	mc->is_vmac = vmac;
+
+	if (vmac) {
+		rc = qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETVMAC,
+					NULL);
+	} else {
+		rc = qeth_l2_send_setgroupmac(card, mac);
+	}
 
-	if (!qeth_l2_send_setgroupmac(card, mac))
+	if (!rc)
 		list_add_tail(&mc->list, &card->mc_list);
 	else
 		kfree(mc);
@@ -201,7 +210,11 @@
 
 	spin_lock_bh(&card->mclock);
 	list_for_each_entry_safe(mc, tmp, &card->mc_list, list) {
-		qeth_l2_send_delgroupmac(card, mc->mc_addr);
+		if (mc->is_vmac)
+			qeth_l2_send_setdelmac(card, mc->mc_addr,
+					IPA_CMD_DELVMAC, NULL);
+		else
+			qeth_l2_send_delgroupmac(card, mc->mc_addr);
 		list_del(&mc->list);
 		kfree(mc);
 	}
@@ -590,7 +603,7 @@
 static void qeth_l2_set_multicast_list(struct net_device *dev)
 {
 	struct qeth_card *card = dev->ml_priv;
-	struct dev_mc_list *dm;
+	struct dev_addr_list *dm;
 
 	if (card->info.type == QETH_CARD_TYPE_OSN)
 		return ;
@@ -599,7 +612,11 @@
 	qeth_l2_del_all_mc(card);
 	spin_lock_bh(&card->mclock);
 	for (dm = dev->mc_list; dm; dm = dm->next)
-		qeth_l2_add_mc(card, dm->dmi_addr);
+		qeth_l2_add_mc(card, dm->da_addr, 0);
+
+	for (dm = dev->uc_list; dm; dm = dm->next)
+		qeth_l2_add_mc(card, dm->da_addr, 1);
+
 	spin_unlock_bh(&card->mclock);
 	if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
 		return;
#3 lore raw

PATCH 3/3 qeth: preallocated header account offset

In reply to [email protected]

From: Frank Blaschka <[email protected]>

When a preallocated header qdio buffer is filled we have to account the offset for the data length.

---

 drivers/s390/net/qeth_core_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +1 -1
Index: git_linus/drivers/s390/net/qeth_core_main.c
===================================================================
@@ -3024,7 +3024,7 @@
 	struct qdio_buffer *buffer, int is_tso, int *next_element_to_fill,
 	int offset)
 {
-	int length = skb->len;
+	int length = skb->len - offset;
 	int length_here;
 	int element;
 	char *data;
#4 lore raw

Re: [patch 3/3] qeth: preallocated header account offset

Quoted 16 lines · [email protected] wrote:

From: Frank Blaschka <[email protected]>

When a preallocated header qdio buffer is filled we have to account the offset for the data length.

---

 drivers/s390/net/qeth_core_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: git_linus/drivers/s390/net/qeth_core_main.c
===================================================================

drivers/s390/net/qeth_core_main.c line 3028

Quoted 6 lines
drivers/s390/net/qeth_core_main.c +1 -1
@@ -3024,7 +3024,7 @@
 	struct qdio_buffer *buffer, int is_tso, int *next_element_to_fill,
 	int offset)
 {
-	int length = skb->len;
+	int length = skb->len - offset;
 	int length_here;

applied 1-3