Commit 86df1439 authored by Heiko Carstens's avatar Heiko Carstens Committed by Linus Torvalds

[PATCH] s390: Network device driver patches

From: Ursula Braun-Krahl <braunu@de.ibm.com>
From: Peter Tiedemann <ptiedem@de.ibm.com>
From: Thomas Spatzier <tspat@de.ibm.com>
From: Frank Pavlic <pavlic@de.ibm.com>

 - 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.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7b7ec6a0
/* /*
* $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 * CTC / ESCON network driver
* *
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 @@ static void ...@@ -320,7 +320,7 @@ static void
print_banner(void) print_banner(void)
{ {
static int printed = 0; static int printed = 0;
char vbuf[] = "$Revision: 1.65 $"; char vbuf[] = "$Revision: 1.68 $";
char *version = vbuf; char *version = vbuf;
if (printed) if (printed)
...@@ -1939,6 +1939,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type) ...@@ -1939,6 +1939,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
ch_fsm, CH_FSM_LEN, GFP_KERNEL); ch_fsm, CH_FSM_LEN, GFP_KERNEL);
if (ch->fsm == NULL) { if (ch->fsm == NULL) {
ctc_pr_warn("ctc: Could not create FSM in add_channel\n"); ctc_pr_warn("ctc: Could not create FSM in add_channel\n");
kfree(ch->ccw);
kfree(ch); kfree(ch);
return -1; return -1;
} }
...@@ -1947,6 +1948,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type) ...@@ -1947,6 +1948,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
GFP_KERNEL)) == NULL) { GFP_KERNEL)) == NULL) {
ctc_pr_warn("ctc: Out of memory in add_channel\n"); ctc_pr_warn("ctc: Out of memory in add_channel\n");
kfree_fsm(ch->fsm); kfree_fsm(ch->fsm);
kfree(ch->ccw);
kfree(ch); kfree(ch);
return -1; return -1;
} }
...@@ -1959,6 +1961,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type) ...@@ -1959,6 +1961,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
"using old entry\n", (*c)->id); "using old entry\n", (*c)->id);
kfree(ch->irb); kfree(ch->irb);
kfree_fsm(ch->fsm); kfree_fsm(ch->fsm);
kfree(ch->ccw);
kfree(ch); kfree(ch);
return 0; return 0;
} }
...@@ -2710,7 +2713,7 @@ buffer_write(struct device *dev, const char *buf, size_t count) ...@@ -2710,7 +2713,7 @@ buffer_write(struct device *dev, const char *buf, size_t count)
struct net_device *ndev; struct net_device *ndev;
int bs1; int bs1;
DBF_TEXT(trace, 5, __FUNCTION__); DBF_TEXT(trace, 3, __FUNCTION__);
priv = dev->driver_data; priv = dev->driver_data;
if (!priv) if (!priv)
return -ENODEV; return -ENODEV;
...@@ -2835,7 +2838,7 @@ static DEVICE_ATTR(stats, 0644, stats_show, stats_write); ...@@ -2835,7 +2838,7 @@ static DEVICE_ATTR(stats, 0644, stats_show, stats_write);
static int static int
ctc_add_attributes(struct device *dev) 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_loglevel);
device_create_file(dev, &dev_attr_stats); device_create_file(dev, &dev_attr_stats);
return 0; return 0;
...@@ -2846,7 +2849,7 @@ ctc_remove_attributes(struct device *dev) ...@@ -2846,7 +2849,7 @@ ctc_remove_attributes(struct device *dev)
{ {
device_remove_file(dev, &dev_attr_stats); device_remove_file(dev, &dev_attr_stats);
device_remove_file(dev, &dev_attr_loglevel); 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 DEVICE_ATTR(type, 0444, ctc_type_show, NULL); ...@@ -2988,6 +2991,7 @@ static DEVICE_ATTR(type, 0444, ctc_type_show, NULL);
static struct attribute *ctc_attr[] = { static struct attribute *ctc_attr[] = {
&dev_attr_protocol.attr, &dev_attr_protocol.attr,
&dev_attr_type.attr, &dev_attr_type.attr,
&dev_attr_buffer.attr,
NULL, NULL,
}; };
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "qeth_mpc.h" #include "qeth_mpc.h"
#define VERSION_QETH_H "$Revision: 1.124 $" #define VERSION_QETH_H "$Revision: 1.129 $"
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
#define QETH_VERSION_IPV6 ":IPv6" #define QETH_VERSION_IPV6 ":IPv6"
...@@ -669,7 +669,6 @@ struct qeth_reply { ...@@ -669,7 +669,6 @@ struct qeth_reply {
#define QETH_BROADCAST_WITHOUT_ECHO 2 #define QETH_BROADCAST_WITHOUT_ECHO 2
struct qeth_card_info { struct qeth_card_info {
char if_name[IF_NAME_LEN];
unsigned short unit_addr2; unsigned short unit_addr2;
unsigned short cula; unsigned short cula;
unsigned short chpid; unsigned short chpid;
...@@ -775,6 +774,8 @@ extern struct list_head qeth_notify_list; ...@@ -775,6 +774,8 @@ extern struct list_head qeth_notify_list;
/*some helper functions*/ /*some helper functions*/
#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
inline static __u8 inline static __u8
qeth_get_ipa_adp_type(enum qeth_link_types link_type) qeth_get_ipa_adp_type(enum qeth_link_types link_type)
{ {
...@@ -1069,4 +1070,9 @@ qeth_schedule_recovery(struct qeth_card *); ...@@ -1069,4 +1070,9 @@ qeth_schedule_recovery(struct qeth_card *);
extern int extern int
qeth_realloc_buffer_pool(struct qeth_card *, 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__ */ #endif /* __QETH_H__ */
This diff is collapsed.
/* /*
* *
* 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 * Linux on zSeries OSA Express and HiperSockets support
* This file contains code related to procfs. * This file contains code related to procfs.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "qeth_mpc.h" #include "qeth_mpc.h"
#include "qeth_fs.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 *****/ /***** /proc/qeth *****/
#define QETH_PROCFILE_NAME "qeth" #define QETH_PROCFILE_NAME "qeth"
...@@ -133,7 +133,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) ...@@ -133,7 +133,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it)
CARD_WDEV_ID(card), CARD_WDEV_ID(card),
CARD_DDEV_ID(card), CARD_DDEV_ID(card),
card->info.chpid, card->info.chpid,
card->info.if_name, QETH_CARD_IFNAME(card),
qeth_get_cardname_short(card), qeth_get_cardname_short(card),
card->info.portno); card->info.portno);
if (card->lan_online) if (card->lan_online)
...@@ -222,7 +222,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) ...@@ -222,7 +222,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
CARD_RDEV_ID(card), CARD_RDEV_ID(card),
CARD_WDEV_ID(card), CARD_WDEV_ID(card),
CARD_DDEV_ID(card), CARD_DDEV_ID(card),
card->info.if_name QETH_CARD_IFNAME(card)
); );
seq_printf(s, " Skb's/buffers received : %li/%i\n" seq_printf(s, " Skb's/buffers received : %li/%i\n"
" Skb's/buffers sent : %li/%i\n\n", " Skb's/buffers sent : %li/%i\n\n",
......
/* /*
* *
* 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 * Linux on zSeries OSA Express and HiperSockets support
* This file contains code related to sysfs. * This file contains code related to sysfs.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "qeth_mpc.h" #include "qeth_mpc.h"
#include "qeth_fs.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 @@ qeth_dev_if_name_show(struct device *dev, char *buf) ...@@ -75,8 +75,7 @@ qeth_dev_if_name_show(struct device *dev, char *buf)
struct qeth_card *card = dev->driver_data; struct qeth_card *card = dev->driver_data;
if (!card) if (!card)
return -EINVAL; return -EINVAL;
return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
return sprintf(buf, "%s\n", card->info.if_name);
} }
static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL); static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
...@@ -440,7 +439,7 @@ qeth_dev_route6_store(struct device *dev, const char *buf, size_t count) ...@@ -440,7 +439,7 @@ qeth_dev_route6_store(struct device *dev, const char *buf, size_t count)
if (!qeth_is_supported(card, IPA_IPV6)){ if (!qeth_is_supported(card, IPA_IPV6)){
PRINT_WARN("IPv6 not supported for interface %s.\n" PRINT_WARN("IPv6 not supported for interface %s.\n"
"Routing status no changed.\n", "Routing status no changed.\n",
card->info.if_name); QETH_CARD_IFNAME(card));
return -ENOTSUPP; return -ENOTSUPP;
} }
...@@ -515,8 +514,15 @@ qeth_dev_fake_ll_store(struct device *dev, const char *buf, size_t count) ...@@ -515,8 +514,15 @@ qeth_dev_fake_ll_store(struct device *dev, const char *buf, size_t count)
return -EPERM; return -EPERM;
i = simple_strtoul(buf, &tmp, 16); i = simple_strtoul(buf, &tmp, 16);
if ((i == 0) || (i == 1)) if ((i == 0) || (i == 1)) {
card->options.fake_ll = i; card->options.fake_ll = i;
if (card->dev) {
if (i)
card->dev->hard_header = qeth_fake_header;
else
card->dev->hard_header = NULL;
}
}
else { else {
PRINT_WARN("fake_ll: write 0 or 1 to this file!\n"); PRINT_WARN("fake_ll: write 0 or 1 to this file!\n");
return -EINVAL; return -EINVAL;
...@@ -715,8 +721,9 @@ qeth_dev_layer2_store(struct device *dev, const char *buf, size_t count) ...@@ -715,8 +721,9 @@ qeth_dev_layer2_store(struct device *dev, const char *buf, size_t count)
if (!card) if (!card)
return -EINVAL; return -EINVAL;
if ((card->state != CARD_STATE_DOWN) && if (((card->state != CARD_STATE_DOWN) &&
(card->state != CARD_STATE_RECOVER)) (card->state != CARD_STATE_RECOVER)) ||
(card->info.type != QETH_CARD_TYPE_OSAE))
return -EPERM; return -EPERM;
i = simple_strtoul(buf, &tmp, 16); i = simple_strtoul(buf, &tmp, 16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment