Skip to contentSkip to conversation

s390: Network device driver patches

PATCH In review Heiko Carstens 1 participant 1 message Dec 28, 2004

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

PATCH 3/8 s390: Network device driver patches

[PATCH 3/8] s390: network drivers.

From: Ursula Braun-Krahl <[email protected]>
From: Peter Tiedemann <[email protected]>
From: Thomas Spatzier <[email protected]>
From: Frank Pavlic <[email protected]>

- ctc: make sysfs attribute buffer early available.
- ctc: remove memory leak for channel ccw struct.
- qeth: remove redundant info card->info.ifname.
- qeth: enable recovery with retries in qeth_hardsetup_card after unit check.
- qeth: do not allow to set layer2 attribute on IQD devices.

diffstat:

 drivers/s390/net/ctcmain.c   |   16 +++--
 drivers/s390/net/qeth.h      |   10 ++-
 drivers/s390/net/qeth_main.c |  128 +++++++++++++++++++++++--------------------
 drivers/s390/net/qeth_proc.c |    8 +-
 drivers/s390/net/qeth_sys.c  |   23 +++++--
 5 files changed, 106 insertions(+), 79 deletions(-)
drivers/s390/net/ctcmain.c +10 -6
diff -urN linux-2.6/drivers/s390/net/ctcmain.c linux-2.6-patched/drivers/s390/net/ctcmain.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ctcmain.c,v 1.65 2004/10/27 09:12:48 mschwide Exp $
+ * $Id: ctcmain.c,v 1.68 2004/12/27 09:25:27 heicarst Exp $
  *
  * CTC / ESCON network driver
  *
@@ -36,7 +36,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.65 $
+ * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.68 $
  *
  */
 
@@ -320,7 +320,7 @@
 print_banner(void)
 {
 	static int printed = 0;
-	char vbuf[] = "$Revision: 1.65 $";
+	char vbuf[] = "$Revision: 1.68 $";
 	char *version = vbuf;
 
 	if (printed)
@@ -1939,6 +1939,7 @@
 			   ch_fsm, CH_FSM_LEN, GFP_KERNEL);
 	if (ch->fsm == NULL) {
 		ctc_pr_warn("ctc: Could not create FSM in add_channel\n");
+		kfree(ch->ccw);
 		kfree(ch);
 		return -1;
 	}
@@ -1947,6 +1948,7 @@
 					      GFP_KERNEL)) == NULL) {
 		ctc_pr_warn("ctc: Out of memory in add_channel\n");
 		kfree_fsm(ch->fsm);
+		kfree(ch->ccw);
 		kfree(ch);
 		return -1;
 	}
@@ -1959,6 +1961,7 @@
 			"using old entry\n", (*c)->id);
 		kfree(ch->irb);
 		kfree_fsm(ch->fsm);
+		kfree(ch->ccw);
 		kfree(ch);
 		return 0;
 	}
@@ -2710,7 +2713,7 @@
 	struct net_device *ndev;
 	int bs1;
 
-	DBF_TEXT(trace, 5, __FUNCTION__);
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	priv = dev->driver_data;
 	if (!priv)
 		return -ENODEV;
@@ -2835,7 +2838,7 @@
 static int
 ctc_add_attributes(struct device *dev)
 {
-	device_create_file(dev, &dev_attr_buffer);
+//	device_create_file(dev, &dev_attr_buffer);
 	device_create_file(dev, &dev_attr_loglevel);
 	device_create_file(dev, &dev_attr_stats);
 	return 0;
@@ -2846,7 +2849,7 @@
 {
 	device_remove_file(dev, &dev_attr_stats);
 	device_remove_file(dev, &dev_attr_loglevel);
-	device_remove_file(dev, &dev_attr_buffer);
+//	device_remove_file(dev, &dev_attr_buffer);
 }
 
 
@@ -2988,6 +2991,7 @@
 static struct attribute *ctc_attr[] = {
 	&dev_attr_protocol.attr,
 	&dev_attr_type.attr,
+	&dev_attr_buffer.attr,
 	NULL,
 };
 
drivers/s390/net/qeth.h +8 -2
diff -urN linux-2.6/drivers/s390/net/qeth.h linux-2.6-patched/drivers/s390/net/qeth.h
@@ -24,7 +24,7 @@
 
 #include "qeth_mpc.h"
 
-#define VERSION_QETH_H 		"$Revision: 1.124 $"
+#define VERSION_QETH_H 		"$Revision: 1.129 $"
 
 #ifdef CONFIG_QETH_IPV6
 #define QETH_VERSION_IPV6 	":IPv6"
@@ -669,7 +669,6 @@
 #define QETH_BROADCAST_WITHOUT_ECHO 2
 
 struct qeth_card_info {
-	char if_name[IF_NAME_LEN];
 	unsigned short unit_addr2;
 	unsigned short cula;
 	unsigned short chpid;
@@ -775,6 +774,8 @@
 
 /*some helper functions*/
 
+#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
+
 inline static __u8
 qeth_get_ipa_adp_type(enum qeth_link_types link_type)
 {
@@ -1069,4 +1070,9 @@
 
 extern int
 qeth_realloc_buffer_pool(struct qeth_card *, int);
+
+extern int
+qeth_fake_header(struct sk_buff *skb, struct net_device *dev,
+                 unsigned short type, void *daddr, void *saddr,
+		 unsigned len);
 #endif /* __QETH_H__ */
drivers/s390/net/qeth_main.c +69 -59

467 lines not on this page · raw message

drivers/s390/net/qeth_proc.c +4 -4
diff -urN linux-2.6/drivers/s390/net/qeth_proc.c linux-2.6-patched/drivers/s390/net/qeth_proc.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.10 $)
+ * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to procfs.
@@ -21,7 +21,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_PROC_C = "$Revision: 1.10 $";
+const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $";
 
 /***** /proc/qeth *****/
 #define QETH_PROCFILE_NAME "qeth"
@@ -133,7 +133,7 @@
 				CARD_WDEV_ID(card),
 				CARD_DDEV_ID(card),
 				card->info.chpid,
-				card->info.if_name,
+				QETH_CARD_IFNAME(card),
 				qeth_get_cardname_short(card),
 				card->info.portno);
 		if (card->lan_online)
@@ -222,7 +222,7 @@
 			CARD_RDEV_ID(card),
 			CARD_WDEV_ID(card),
 			CARD_DDEV_ID(card),
-			card->info.if_name
+			QETH_CARD_IFNAME(card)
 		  );
 	seq_printf(s, "  Skb's/buffers received                 : %li/%i\n"
 		      "  Skb's/buffers sent                     : %li/%i\n\n",
drivers/s390/net/qeth_sys.c +15 -8
diff -urN linux-2.6/drivers/s390/net/qeth_sys.c linux-2.6-patched/drivers/s390/net/qeth_sys.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.40 $)
+ * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.48 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to sysfs.
@@ -20,7 +20,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_SYS_C = "$Revision: 1.40 $";
+const char *VERSION_QETH_SYS_C = "$Revision: 1.48 $";
 
 /*****************************************************************************/
 /*                                                                           */
@@ -75,8 +75,7 @@
 	struct qeth_card *card = dev->driver_data;
 	if (!card)
 		return -EINVAL;
-
-	return sprintf(buf, "%s\n", card->info.if_name);
+	return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
 }
 
 static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
@@ -440,7 +439,7 @@
 	if (!qeth_is_supported(card, IPA_IPV6)){
 		PRINT_WARN("IPv6 not supported for interface %s.\n"
 			   "Routing status no changed.\n",
-			   card->info.if_name);
+			   QETH_CARD_IFNAME(card));
 		return -ENOTSUPP;
 	}
 
@@ -515,8 +514,15 @@
 		return -EPERM;
 
 	i = simple_strtoul(buf, &tmp, 16);
-	if ((i == 0) || (i == 1))
+	if ((i == 0) || (i == 1)) {
 		card->options.fake_ll = i;
+		if (card->dev) {
+			if (i)
+  				card->dev->hard_header = qeth_fake_header;
+			else
+				card->dev->hard_header = NULL;
+		}
+	}
 	else {
 		PRINT_WARN("fake_ll: write 0 or 1 to this file!\n");
 		return -EINVAL;
@@ -715,8 +721,9 @@
 	if (!card)
 		return -EINVAL;
 
-	if ((card->state != CARD_STATE_DOWN) &&
-	    (card->state != CARD_STATE_RECOVER))
+	if (((card->state != CARD_STATE_DOWN) &&
+	     (card->state != CARD_STATE_RECOVER)) ||
+	    (card->info.type != QETH_CARD_TYPE_OSAE))
 		return -EPERM;
 
 	i = simple_strtoul(buf, &tmp, 16);