[PATCH 0/8] s390: network device driver fixes
Hi Jeff, following eight patches are all fixes for s390 network device driver qeth, claw and netiucv. I would be glad to see them going into 2.6.22 although I know it is quite late . Thank you. Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/8] s390: qeth driver does not recover
From: Ursula Braun [EMAIL PROTECTED] While first recovery continues, the card issues a STARTLAN command itself. In this case qeth schedules another recovery. This second recovery is cancelled because of an already running first recovery. Stop first recovery in case of 0xe080. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index ea2fd98..c5a9507 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -986,15 +986,15 @@ qeth_recover(void *ptr) card-use_hard_stop = 1; __qeth_set_offline(card-gdev,1); rc = __qeth_set_online(card-gdev,1); + /* don't run another scheduled recovery */ + qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); + qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); if (!rc) PRINT_INFO(Device %s successfully recovered!\n, CARD_BUS_ID(card)); else PRINT_INFO(Device %s could not be recovered!\n, CARD_BUS_ID(card)); - /* don't run another scheduled recovery */ - qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); - qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); return 0; } @@ -7476,11 +7476,11 @@ qeth_softsetup_card(struct qeth_card *card) QETH_DBF_TEXT_(setup, 2, 1err%d, rc); if (rc == 0xe080){ PRINT_WARN(LAN on card %s if offline! - Continuing softsetup.\n, + Waiting for STARTLAN from card.\n, CARD_BUS_ID(card)); card-lan_online = 0; - } else - return rc; + } + return rc; } else card-lan_online = 1; if (card-info.type==QETH_CARD_TYPE_OSN) -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/8] s390: print correct level for HiperSockets devices
From: Ursula Braun [EMAIL PROTECTED] For real HiperSockets the EBCDIC-ASCII conversion is not necessary. This is only needed for z/VM GuestLAN devices. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 20 +++- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 0b96d49..ea2fd98 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7797,15 +7797,17 @@ qeth_print_status_message(struct qeth_card *card) } /* fallthrough */ case QETH_CARD_TYPE_IQD: - card-info.mcl_level[0] = (char) _ebcasc[(__u8) - card-info.mcl_level[0]]; - card-info.mcl_level[1] = (char) _ebcasc[(__u8) - card-info.mcl_level[1]]; - card-info.mcl_level[2] = (char) _ebcasc[(__u8) - card-info.mcl_level[2]]; - card-info.mcl_level[3] = (char) _ebcasc[(__u8) - card-info.mcl_level[3]]; - card-info.mcl_level[QETH_MCL_LENGTH] = 0; + if (card-info.guestlan) { + card-info.mcl_level[0] = (char) _ebcasc[(__u8) + card-info.mcl_level[0]]; + card-info.mcl_level[1] = (char) _ebcasc[(__u8) + card-info.mcl_level[1]]; + card-info.mcl_level[2] = (char) _ebcasc[(__u8) + card-info.mcl_level[2]]; + card-info.mcl_level[3] = (char) _ebcasc[(__u8) + card-info.mcl_level[3]]; + card-info.mcl_level[QETH_MCL_LENGTH] = 0; + } break; default: memset(card-info.mcl_level[0], 0, QETH_MCL_LENGTH + 1); -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/8] s390: qeth: wrong packet length in qdio header
From: Frank Pavlic [EMAIL PROTECTED] Packets Length in qdio header is broken when using EDDP on Layer2 devices. This leads to skb_under_panic on receiver system when running on z/VM GuestLAN devices. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_eddp.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 4640f32..70108fb 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -424,8 +424,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, /* prepare qdio hdr */ if (eddp-qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2){ eddp-qh.hdr.l2.pkt_length = data_len + ETH_HLEN + -eddp-nhl + eddp-thl - -sizeof(struct qeth_hdr); +eddp-nhl + eddp-thl; #ifdef CONFIG_QETH_VLAN if (eddp-mac.h_proto == __constant_htons(ETH_P_8021Q)) eddp-qh.hdr.l2.pkt_length += VLAN_HLEN; -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/8] s390: Use ccw_device_get_id() in qeth/claw drivers
From: Cornelia Huck [EMAIL PROTECTED] Use ccw_device_get_id() to get a device number instead of parsing the ccw device's bus id. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/claw.c | 13 - drivers/s390/net/qeth_main.c | 12 +++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 6dd64d0..348bb7b 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -3912,6 +3912,7 @@ static int add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) { struct chbk *p_ch; + struct ccw_dev_id dev_id; #ifdef FUNCTRACE printk(KERN_INFO %s:%s Enter\n,cdev-dev.bus_id,__FUNCTION__); @@ -3921,7 +3922,8 @@ add_channel(struct ccw_device *cdev,int i,struct claw_privbk *privptr) p_ch = privptr-channel[i]; p_ch-cdev = cdev; snprintf(p_ch-id, CLAW_ID_SIZE, cl-%s, cdev-dev.bus_id); - sscanf(cdev-dev.bus_id+4,%x,p_ch-devno); + ccw_device_get_id(cdev, dev_id); + p_ch-devno = dev_id.devno; if ((p_ch-irb = kmalloc(sizeof (struct irb),GFP_KERNEL)) == NULL) { printk(KERN_WARNING %s Out of memory in %s for irb\n, p_ch-id,__FUNCTION__); @@ -3955,6 +3957,7 @@ claw_new_device(struct ccwgroup_device *cgdev) struct claw_env *p_env; struct net_device *dev; int ret; + struct ccw_dev_id dev_id; pr_debug(%s() called\n, __FUNCTION__); printk(KERN_INFO claw: add for %s\n,cgdev-cdev[READ]-dev.bus_id); @@ -3965,10 +3968,10 @@ claw_new_device(struct ccwgroup_device *cgdev) if (!privptr) return -ENODEV; p_env = privptr-p_env; - sscanf(cgdev-cdev[READ]-dev.bus_id+4,%x, - p_env-devno[READ]); -sscanf(cgdev-cdev[WRITE]-dev.bus_id+4,%x, - p_env-devno[WRITE]); + ccw_device_get_id(cgdev-cdev[READ], dev_id); + p_env-devno[READ] = dev_id.devno; + ccw_device_get_id(cgdev-cdev[WRITE], dev_id); + p_env-devno[WRITE] = dev_id.devno; ret = add_channel(cgdev-cdev[0],0,privptr); if (ret == 0) ret = add_channel(cgdev-cdev[1],1,privptr); diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 79b7379..86b0c44 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -2176,13 +2176,6 @@ qeth_ulp_enable(struct qeth_card *card) } -static inline __u16 -__raw_devno_from_bus_id(char *id) -{ - id += (strlen(id) - 4); - return (__u16) simple_strtoul(id, id, 16); -} - static int qeth_ulp_setup_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) @@ -2205,6 +2198,7 @@ qeth_ulp_setup(struct qeth_card *card) int rc; __u16 temp; struct qeth_cmd_buffer *iob; + struct ccw_dev_id dev_id; QETH_DBF_TEXT(setup,2,ulpsetup); @@ -2218,8 +2212,8 @@ qeth_ulp_setup(struct qeth_card *card) memcpy(QETH_ULP_SETUP_FILTER_TOKEN(iob-data), card-token.ulp_filter_r, QETH_MPC_TOKEN_LENGTH); - temp = __raw_devno_from_bus_id(CARD_DDEV_ID(card)); - memcpy(QETH_ULP_SETUP_CUA(iob-data), temp, 2); + ccw_device_get_id(CARD_DDEV(card), dev_id); + memcpy(QETH_ULP_SETUP_CUA(iob-data), dev_id.devno, 2); temp = (card-info.cula 8) + card-info.unit_addr2; memcpy(QETH_ULP_SETUP_REAL_DEVADDR(iob-data), temp, 2); rc = qeth_send_control_data(card, ULP_SETUP_SIZE, iob, -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] s390: avoid inconsistent lock state in qeth
From: Ursula Braun [EMAIL PROTECTED] ipv6_regen_rndid in net/ipv6/addrconf.c makes use of write_lock_bh for its inet6_dev-lock. It may run in softirq-context. qeth makes use of read_lock for the same inet6_dev-lock. To avoid a potential deadlock situation, qeth should make use of read_lock_bh for its usages of inet6_dev-lock. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index c5a9507..79b7379 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -5850,9 +5850,9 @@ qeth_add_vlan_mc6(struct qeth_card *card) in_dev = in6_dev_get(netdev); if (!in_dev) continue; - read_lock(in_dev-lock); + read_lock_bh(in_dev-lock); qeth_add_mc6(card,in_dev); - read_unlock(in_dev-lock); + read_unlock_bh(in_dev-lock); in6_dev_put(in_dev); } #endif /* CONFIG_QETH_VLAN */ @@ -5869,10 +5869,10 @@ qeth_add_multicast_ipv6(struct qeth_card *card) in6_dev = in6_dev_get(card-dev); if (in6_dev == NULL) return; - read_lock(in6_dev-lock); + read_lock_bh(in6_dev-lock); qeth_add_mc6(card, in6_dev); qeth_add_vlan_mc6(card); - read_unlock(in6_dev-lock); + read_unlock_bh(in6_dev-lock); in6_dev_put(in6_dev); } #endif /* CONFIG_QETH_IPV6 */ -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/8] s390: netiucv spinlock initializer cleanup
From: Thomas Gleixner [EMAIL PROTECTED] spinlock initializer cleanup in netiucv.c Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/netiucv.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 648ee13..5303aea 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -212,7 +212,7 @@ struct iucv_connection { */ static struct list_head iucv_connection_list = LIST_HEAD_INIT(iucv_connection_list); -static rwlock_t iucv_connection_rwlock = RW_LOCK_UNLOCKED; +static DEFINE_RWLOCK(iucv_connection_rwlock); /** * Representation of event-data for the -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 8/8] s390: netiucv inlining cleanup
From: Martin Schwidefsky [EMAIL PROTECTED] The recent iucv rework patches re-introduced some unnecessary inlines. Remove them again. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/net/netiucv.c | 18 +++--- 1 files changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 5303aea..3d28e1a 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -134,18 +134,6 @@ PRINT_##importance(header %02x %02x %02x %02x %02x %02x %02x %02x \ *(((char*)ptr)+28),*(((char*)ptr)+29), \ *(((char*)ptr)+30),*(((char*)ptr)+31)); -static inline void iucv_hex_dump(unsigned char *buf, size_t len) -{ - size_t i; - - for (i = 0; i len; i++) { - if (i !(i % 16)) - printk(\n); - printk(%02x , *(buf + i)); - } - printk(\n); -} - #define PRINTK_HEADER iucv:/* for debugging */ static struct device_driver netiucv_driver = { @@ -280,7 +268,7 @@ static u8 iucvMagic[16] = { * * @returns The printable string (static data!!) */ -static inline char *netiucv_printname(char *name) +static char *netiucv_printname(char *name) { static char tmp[9]; char *p = tmp; @@ -1730,7 +1718,7 @@ static struct attribute_group netiucv_stat_attr_group = { .attrs = netiucv_stat_attrs, }; -static inline int netiucv_add_files(struct device *dev) +static int netiucv_add_files(struct device *dev) { int ret; @@ -1744,7 +1732,7 @@ static inline int netiucv_add_files(struct device *dev) return ret; } -static inline void netiucv_remove_files(struct device *dev) +static void netiucv_remove_files(struct device *dev) { IUCV_DBF_TEXT(trace, 3, __FUNCTION__); sysfs_remove_group(dev-kobj, netiucv_stat_attr_group); -- 1.5.2.1 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/2] [AF_IUCV]: Implementation of a skb backlog queue
From: Jennifer Hunt [EMAIL PROTECTED] With the inital implementation we missed to implement a skb backlog queue . The result is that socket receive processing tossed packets. Since AF_IUCV connections are working synchronously it leads to connection hangs. Problems with read, close and select also occured. Using a skb backlog queue is fixing all of these problems . Signed-off-by: Jennifer Hunt[EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- include/net/iucv/af_iucv.h |2 net/iucv/af_iucv.c | 159 - 2 files changed, 132 insertions(+), 29 deletions(-) diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index 04d1abb..f9bd11b 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h @@ -28,6 +28,7 @@ enum { IUCV_LISTEN, IUCV_SEVERED, IUCV_DISCONN, + IUCV_CLOSING, IUCV_CLOSED }; @@ -62,6 +63,7 @@ struct iucv_sock { struct sock *parent; struct iucv_path*path; struct sk_buff_head send_skb_q; + struct sk_buff_head backlog_skb_q; unsigned intsend_tag; }; diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index e84c924..026704a 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -147,6 +147,7 @@ static void iucv_sock_close(struct sock *sk) unsigned char user_data[16]; struct iucv_sock *iucv = iucv_sk(sk); int err; + unsigned long timeo; iucv_sock_clear_timer(sk); lock_sock(sk); @@ -159,6 +160,21 @@ static void iucv_sock_close(struct sock *sk) case IUCV_CONNECTED: case IUCV_DISCONN: err = 0; + + sk-sk_state = IUCV_CLOSING; + sk-sk_state_change(sk); + + if(!skb_queue_empty(iucv-send_skb_q)) { + if (sock_flag(sk, SOCK_LINGER) sk-sk_lingertime) + timeo = sk-sk_lingertime; + else + timeo = IUCV_DISCONN_TIMEOUT; + err = iucv_sock_wait_state(sk, IUCV_CLOSED, 0, timeo); + } + + sk-sk_state = IUCV_CLOSED; + sk-sk_state_change(sk); + if (iucv-path) { low_nmcpy(user_data, iucv-src_name); high_nmcpy(user_data, iucv-dst_name); @@ -168,12 +184,11 @@ static void iucv_sock_close(struct sock *sk) iucv-path = NULL; } - sk-sk_state = IUCV_CLOSED; - sk-sk_state_change(sk); sk-sk_err = ECONNRESET; sk-sk_state_change(sk); skb_queue_purge(iucv-send_skb_q); + skb_queue_purge(iucv-backlog_skb_q); sock_set_flag(sk, SOCK_ZAPPED); break; @@ -204,6 +219,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) sock_init_data(sock, sk); INIT_LIST_HEAD(iucv_sk(sk)-accept_q); skb_queue_head_init(iucv_sk(sk)-send_skb_q); + skb_queue_head_init(iucv_sk(sk)-backlog_skb_q); iucv_sk(sk)-send_tag = 0; sk-sk_destruct = iucv_sock_destruct; @@ -510,7 +526,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, long timeo; int err = 0; - lock_sock(sk); + lock_sock_nested(sk, SINGLE_DEPTH_NESTING); if (sk-sk_state != IUCV_LISTEN) { err = -EBADFD; @@ -530,7 +546,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, release_sock(sk); timeo = schedule_timeout(timeo); - lock_sock(sk); + lock_sock_nested(sk, SINGLE_DEPTH_NESTING); if (sk-sk_state != IUCV_LISTEN) { err = -EBADFD; @@ -606,7 +622,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, if(!(skb = sock_alloc_send_skb(sk, len, msg-msg_flags MSG_DONTWAIT, err))) - return err; + goto out; if (memcpy_fromiovec(skb_put(skb, len), msg-msg_iov, len)){ err = -EFAULT; @@ -647,10 +663,16 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, { int noblock = flags MSG_DONTWAIT; struct sock *sk = sock-sk; + struct iucv_sock *iucv = iucv_sk(sk); int target, copied = 0; - struct sk_buff *skb; + struct sk_buff *skb, *rskb, *cskb; int err = 0; + if ((sk-sk_state == IUCV_DISCONN || sk-sk_state == IUCV_SEVERED) + skb_queue_empty(iucv-backlog_skb_q) + skb_queue_empty(sk-sk_receive_queue)) + return 0; + if (flags (MSG_OOB)) return -EOPNOTSUPP
[PATCH 0/4]: s390: network driver fixes and feature
Hi , this is the second version of patches I have sent already two days ago. I removed the kthread_run patch (3/5) . Patches 1-3 contain fixes,patch 4 includes some kind of a new feature although it is just an adaption to the latest OSA hardware specification and just prints out human readable text on specific error return codes. Please apply them . Thank you . Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/4] s390: qeth driver connection hang
From: Ursula Braun [EMAIL PROTECTED] Frank Pavlic [EMAIL PROTECTED] Connection hangs when using EDDP mode because sk_protocol is NULL when skb has been copied via skb_copy. This results in dropping packets. Also keep MAC address after recovery of Virtual NICs so that traffic can flow again and duplicate statements in qeth_dev_set_route_store removed. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- qeth_eddp.c |4 ++-- qeth_eddp.h |3 ++- qeth_main.c |5 +++-- qeth_sys.c |2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index dd7034f..4640f32 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -620,10 +620,10 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, struct qeth_eddp_context * qeth_eddp_create_context(struct qeth_card *card, struct sk_buff *skb, -struct qeth_hdr *qhdr) +struct qeth_hdr *qhdr, unsigned char sk_protocol) { QETH_DBF_TEXT(trace, 5, creddpc); - switch (skb-sk-sk_protocol){ + switch (sk_protocol) { case IPPROTO_TCP: return qeth_eddp_create_context_tcp(card, skb, qhdr); default: diff --git a/drivers/s390/net/qeth_eddp.h b/drivers/s390/net/qeth_eddp.h index 103768d..52910c9 100644 --- a/drivers/s390/net/qeth_eddp.h +++ b/drivers/s390/net/qeth_eddp.h @@ -34,7 +34,8 @@ struct qeth_eddp_context_reference { }; extern struct qeth_eddp_context * -qeth_eddp_create_context(struct qeth_card *,struct sk_buff *,struct qeth_hdr *); +qeth_eddp_create_context(struct qeth_card *,struct sk_buff *, +struct qeth_hdr *, unsigned char); extern void qeth_eddp_put_context(struct qeth_eddp_context *); diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index ad7792d..54839fa 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -4423,7 +4423,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) qeth_fill_header(card, hdr, new_skb, ipv, cast_type); } if (large_send == QETH_LARGE_SEND_EDDP) { - ctx = qeth_eddp_create_context(card, new_skb, hdr); + ctx = qeth_eddp_create_context(card, new_skb, hdr, + skb-sk-sk_protocol); if (ctx == NULL) { __qeth_free_new_skb(skb, new_skb); PRINT_WARN(could not create eddp context\n); @@ -6584,7 +6585,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, QETH_DBF_TEXT(trace,4,chgmaccb); cmd = (struct qeth_ipa_cmd *) data; - if (!card-options.layer2 || card-info.guestlan || + if (!card-options.layer2 || !(card-info.mac_bits QETH_LAYER2_MAC_READ)) { memcpy(card-dev-dev_addr, cmd-data.setadapterparms.data.change_addr.addr, diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index d518419..65ffc21 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -384,8 +384,6 @@ qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route, route-type = PRIMARY_CONNECTOR; } else if (!strcmp(tmp, secondary_connector)) { route-type = SECONDARY_CONNECTOR; - } else if (!strcmp(tmp, multicast_router)) { - route-type = MULTICAST_ROUTER; } else if (!strcmp(tmp, primary_router)) { route-type = PRIMARY_ROUTER; } else if (!strcmp(tmp, secondary_router)) { -- 1.5.1.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/4] s390: free skbs in finite amount of time in qeth
From: Ursula Braun [EMAIL PROTECTED] Free sent skbs in some finite amount of time. Affected are asynchronous queue of Hipersockets devices and the output queues of all eth-devices respectively. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/cio/qdio.c | 37 +++-- drivers/s390/cio/qdio.h |4 +++- drivers/s390/net/qeth_main.c | 14 -- include/asm-s390/qdio.h |1 + 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 05fac07..06bae6a 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -978,18 +978,25 @@ __qdio_outbound_processing(struct qdio_q *q) if (qdio_has_outbound_q_moved(q)) qdio_kick_outbound_handler(q); - if (q-is_iqdio_q) { + if (q-queue_type == QDIO_ZFCP_QFMT) { + if ((!q-hydra_gives_outbound_pcis) + (!qdio_is_outbound_q_done(q))) + qdio_mark_q(q); + } + else if (((!q-is_iqdio_q) (!q-is_pci_out)) || +(q-queue_type == QDIO_IQDIO_QFMT_ASYNCH)) { /* -* for asynchronous queues, we better check, if the sent -* buffer is already switched from PRIMED to EMPTY. +* make sure buffer switch from PRIMED to EMPTY is noticed +* and outbound_handler is called */ - if ((q-queue_type == QDIO_IQDIO_QFMT_ASYNCH) - !qdio_is_outbound_q_done(q)) - qdio_mark_q(q); - - } else if (!q-hydra_gives_outbound_pcis) - if (!qdio_is_outbound_q_done(q)) - qdio_mark_q(q); + if (qdio_is_outbound_q_done(q)) { + del_timer(q-timer); + } else { + if (!timer_pending(q-timer)) + mod_timer(q-timer, jiffies + + QDIO_FORCE_CHECK_TIMEOUT); + } + } qdio_release_q(q); } @@ -1830,6 +1837,7 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-queue_type = QDIO_IQDIO_QFMT_ASYNCH; q-int_parm=int_parm; q-is_input_q=0; + q-is_pci_out = 0; q-schid = irq_ptr-schid; q-cdev = cdev; q-irq_ptr = irq_ptr; @@ -1842,6 +1850,10 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-tasklet.data=(unsigned long)q; q-tasklet.func=(void(*)(unsigned long)) qdio_outbound_processing; + q-timer.function=(void(*)(unsigned long)) + qdio_outbound_processing; + q-timer.data = (long)q; + init_timer(q-timer); atomic_set(q-busy_siga_counter,0); q-timing.busy_start=0; @@ -2648,6 +2660,7 @@ qdio_shutdown(struct ccw_device *cdev, int how) for (i=0;iirq_ptr-no_output_qs;i++) { tasklet_kill(irq_ptr-output_qs[i]-tasklet); + del_timer(irq_ptr-output_qs[i]-timer); wait_event_interruptible_timeout(cdev-private-wait_q, !atomic_read(irq_ptr- output_qs[i]- @@ -3477,6 +3490,10 @@ do_qdio_handle_outbound(struct qdio_q *q, unsigned int callflags, } return; } + if (callflags QDIO_FLAG_PCI_OUT) + q-is_pci_out = 1; + else + q-is_pci_out = 0; if (q-is_iqdio_q) { /* one siga for every sbal */ while (count--) diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index ec9af72..6d0bcd2 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -60,6 +60,7 @@ #define QDIO_ACTIVATE_TIMEOUT ((5*HZ)10) #define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ) #define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ) +#define QDIO_FORCE_CHECK_TIMEOUT (10*HZ) enum qdio_irq_states { QDIO_IRQ_STATE_INACTIVE, @@ -489,8 +490,8 @@ struct qdio_q { void *irq_ptr; -#ifdef QDIO_USE_TIMERS_FOR_POLLING struct timer_list timer; +#ifdef QDIO_USE_TIMERS_FOR_POLLING atomic_t timer_already_set; spinlock_t timer_lock; #else /* QDIO_USE_TIMERS_FOR_POLLING */ @@ -536,6 +537,7 @@ struct qdio_q { } timing; atomic_t busy_siga_counter; unsigned int queue_type; + unsigned int is_pci_out; /* leave this member at the end. won't be cleared in qdio_fill_qs */ struct slib *slib; /* a page is allocated under this pointer, diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 54839fa..e0eb113 100644 --- a/drivers/s390/net/qeth_main.c +++ b
[PATCH 4/4] s390: qeth driver hardware specs adaptions
From: Peter Tiedemann [EMAIL PROTECTED] s390: qeth driver hardware specs adaptions - according to the latest OSA hardware specification incorporate actual IPA command and return codes into qeth. - whitespaces removed from qeth_mpc.h Signed-off-by: Peter Tiedemann [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- qeth_main.c | 26 +-- qeth_mpc.c | 101 +++ qeth_mpc.h | 219 ++-- 3 files changed, 247 insertions(+), 99 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index e0eb113..aaa5703 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1615,6 +1615,21 @@ qeth_put_reply(struct qeth_reply *reply) kfree(reply); } +static void +qeth_issue_ipa_msg(struct qeth_ipa_cmd *cmd, struct qeth_card *card) +{ + int rc; + int com; + char * ipa_name; + + com = cmd-hdr.command; + rc = cmd-hdr.return_code; + ipa_name = qeth_get_ipa_cmd_name(com); + + PRINT_ERR(%s(x%X) for %s returned x%X \%s\\n, ipa_name, com, + QETH_CARD_IFNAME(card), rc, qeth_get_ipa_msg(rc)); +} + static struct qeth_ipa_cmd * qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) { @@ -1623,8 +1638,11 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) QETH_DBF_TEXT(trace,5,chkipad); if (IS_IPA(iob-data)){ cmd = (struct qeth_ipa_cmd *) PDU_ENCAPSULATION(iob-data); - if (IS_IPA_REPLY(cmd)) + if (IS_IPA_REPLY(cmd)) { + if (cmd-hdr.return_code) + qeth_issue_ipa_msg(cmd, card); return cmd; + } else { switch (cmd-hdr.command) { case IPA_CMD_STOPLAN: @@ -5883,9 +5901,6 @@ qeth_layer2_send_setmac_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (cmd-hdr.return_code) { QETH_DBF_TEXT_(trace, 2, L2er%x, cmd-hdr.return_code); - PRINT_WARN(Error in registering MAC address on \ - device %s: x%x\n, CARD_BUS_ID(card), - cmd-hdr.return_code); card-info.mac_bits = ~QETH_LAYER2_MAC_REGISTERED; cmd-hdr.return_code = -EIO; } else { @@ -5920,9 +5935,6 @@ qeth_layer2_send_delmac_cb(struct qeth_card *card, QETH_DBF_TEXT(trace, 2, L2Dmaccb); cmd = (struct qeth_ipa_cmd *) data; if (cmd-hdr.return_code) { - PRINT_WARN(Error in deregistering MAC address on \ - device %s: x%x\n, CARD_BUS_ID(card), - cmd-hdr.return_code); QETH_DBF_TEXT_(trace, 2, err%d, cmd-hdr.return_code); cmd-hdr.return_code = -EIO; return 0; diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c index 77c8320..f54fdfd 100644 --- a/drivers/s390/net/qeth_mpc.c +++ b/drivers/s390/net/qeth_mpc.c @@ -157,12 +157,113 @@ unsigned char READ_CCW[]={ }; +struct ipa_rc_msg { + enum qeth_ipa_return_codes rc; + char *msg; +}; +struct ipa_rc_msg qeth_ipa_rc_msg[] = { + {IPA_RC_SUCCESS,success}, + {IPA_RC_NOTSUPP,Command not supported}, + {IPA_RC_IP_TABLE_FULL, Add Addr IP Table Full - ipv6}, + {IPA_RC_UNKNOWN_ERROR, IPA command failed - reason unknown}, + {IPA_RC_UNSUPPORTED_COMMAND,Command not supported}, + {IPA_RC_DUP_IPV6_REMOTE,ipv6 address already registered remote}, + {IPA_RC_DUP_IPV6_HOME, ipv6 address already registered}, + {IPA_RC_UNREGISTERED_ADDR, Address not registered}, + {IPA_RC_NO_ID_AVAILABLE,No identifiers available}, + {IPA_RC_ID_NOT_FOUND, Identifier not found}, + {IPA_RC_INVALID_IP_VERSION, IP version incorrect}, + {IPA_RC_LAN_FRAME_MISMATCH, LAN and frame mismatch}, + {IPA_RC_L2_UNSUPPORTED_CMD, Unsupported layer 2 command}, + {IPA_RC_L2_DUP_MAC, Duplicate MAC address}, + {IPA_RC_L2_ADDR_TABLE_FULL, Layer2 address table full}, + {IPA_RC_L2_DUP_LAYER3_MAC, Duplicate with layer 3 MAC}, + {IPA_RC_L2_GMAC_NOT_FOUND, GMAC not found}, + {IPA_RC_L2_MAC_NOT_FOUND, L2 mac address not found}, + {IPA_RC_L2_INVALID_VLAN_ID, L2 invalid vlan id}, + {IPA_RC_L2_DUP_VLAN_ID, L2 duplicate vlan id}, + {IPA_RC_L2_VLAN_ID_NOT_FOUND, L2 vlan id not found}, + {IPA_RC_DATA_MISMATCH, Data field mismatch (v4/v6 mixed)}, + {IPA_RC_INVALID_MTU_SIZE, Invalid MTU size}, + {IPA_RC_INVALID_LANTYPE,Invalid LAN type}, + {IPA_RC_INVALID_LANNUM, Invalid LAN num
[PATCH 4/5] s390: fix Oops when unloading module netiucv
From: Ursula Braun [EMAIL PROTECTED] don't remove an entry from iucv_connection_list in netiucv_exit(). netiucv_free_netdevice is called anyway, which takes care of entry removal. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- netiucv.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index e10e85e..c358764 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -1862,12 +1862,14 @@ static void netiucv_remove_connection(struct iucv_connection *conn) write_lock_bh(iucv_connection_rwlock); list_del_init(conn-list); write_unlock_bh(iucv_connection_rwlock); + fsm_deltimer(conn-timer); + netiucv_purge_skb_queue(conn-collect_queue); if (conn-path) { iucv_path_sever(conn-path, iucvMagic); kfree(conn-path); conn-path = NULL; } - fsm_deltimer(conn-timer); + netiucv_purge_skb_queue(conn-commit_queue); kfree_fsm(conn-fsm); kfree_skb(conn-rx_buff); kfree_skb(conn-tx_buff); @@ -2115,7 +2117,6 @@ static void __exit netiucv_exit(void) while (!list_empty(iucv_connection_list)) { cp = list_entry(iucv_connection_list.next, struct iucv_connection, list); - list_del(cp-list); ndev = cp-netdev; priv = netdev_priv(ndev); dev = priv-dev; -- 1.5.1.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] s390: use kthread_run in qeth and lcs
From: Eric Biederman [EMAIL PROTECTED] This patch modifies the qeth_recover thread to be started with kthread_run not a combination of kernel_thread and daemonize. Resulting in slightly simpler and more maintainable code. Signed-off-by: Eric W. Biederman [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- lcs.c |8 +++- qeth_main.c |4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 08a994f..0300d87 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -36,6 +36,7 @@ #include linux/in.h #include linux/igmp.h #include linux/delay.h +#include linux/kthread.h #include net/arp.h #include net/ip.h @@ -1248,7 +1249,6 @@ lcs_register_mc_addresses(void *data) struct in_device *in4_dev; card = (struct lcs_card *) data; - daemonize(regipm); if (!lcs_do_run_thread(card, LCS_SET_MC_THREAD)) return 0; @@ -1728,11 +1728,10 @@ lcs_start_kernel_thread(struct work_struct *work) struct lcs_card *card = container_of(work, struct lcs_card, kernel_thread_starter); LCS_DBF_TEXT(5, trace, krnthrd); if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD)) - kernel_thread(lcs_recovery, (void *) card, SIGCHLD); + kthread_run(lcs_recovery, card, lcs_recover); #ifdef CONFIG_IP_MULTICAST if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) - kernel_thread(lcs_register_mc_addresses, - (void *) card, SIGCHLD); + kernel_run(lcs_register_mc_addresses, card, regipm); #endif } @@ -2232,7 +2231,6 @@ lcs_recovery(void *ptr) int rc; card = (struct lcs_card *) ptr; - daemonize(lcs_recover); LCS_DBF_TEXT(4, trace, recover1); if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD)) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index e0eb113..0d10ee0 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -50,6 +50,7 @@ #include linux/mii.h #include linux/rcupdate.h #include linux/ethtool.h +#include linux/kthread.h #include net/arp.h #include net/ip.h @@ -957,7 +958,6 @@ qeth_recover(void *ptr) int rc = 0; card = (struct qeth_card *) ptr; - daemonize(qeth_recover); QETH_DBF_TEXT(trace,2,recover1); QETH_DBF_HEX(trace, 2, card, sizeof(void *)); if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) @@ -1014,7 +1014,7 @@ qeth_start_kernel_thread(struct work_struct *work) card-write.state != CH_STATE_UP) return; if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) - kernel_thread(qeth_recover, (void *) card, SIGCHLD); + kthread_run(qeth_recover, card, qeth_recover); } -- 1.5.1.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/5] s390: fix connection hang in qeth
From: Ursula Braun [EMAIL PROTECTED] Frank Pavlic [EMAIL PROTECTED] Connection hangs when using EDDP mode because sk is NULL when skb has been copied via skb_copy. This results in dropping packets. Also keep MAC address after recovery of Virtual NICs so that traffic can flow again and duplicate statements in qeth_dev_set_route_store removed. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- qeth_eddp.c |4 ++-- qeth_eddp.h |3 ++- qeth_main.c |5 +++-- qeth_sys.c |2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index dd7034f..4640f32 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -620,10 +620,10 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, struct qeth_eddp_context * qeth_eddp_create_context(struct qeth_card *card, struct sk_buff *skb, -struct qeth_hdr *qhdr) +struct qeth_hdr *qhdr, unsigned char sk_protocol) { QETH_DBF_TEXT(trace, 5, creddpc); - switch (skb-sk-sk_protocol){ + switch (sk_protocol) { case IPPROTO_TCP: return qeth_eddp_create_context_tcp(card, skb, qhdr); default: diff --git a/drivers/s390/net/qeth_eddp.h b/drivers/s390/net/qeth_eddp.h index 103768d..52910c9 100644 --- a/drivers/s390/net/qeth_eddp.h +++ b/drivers/s390/net/qeth_eddp.h @@ -34,7 +34,8 @@ struct qeth_eddp_context_reference { }; extern struct qeth_eddp_context * -qeth_eddp_create_context(struct qeth_card *,struct sk_buff *,struct qeth_hdr *); +qeth_eddp_create_context(struct qeth_card *,struct sk_buff *, +struct qeth_hdr *, unsigned char); extern void qeth_eddp_put_context(struct qeth_eddp_context *); diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index ad7792d..54839fa 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -4423,7 +4423,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) qeth_fill_header(card, hdr, new_skb, ipv, cast_type); } if (large_send == QETH_LARGE_SEND_EDDP) { - ctx = qeth_eddp_create_context(card, new_skb, hdr); + ctx = qeth_eddp_create_context(card, new_skb, hdr, + skb-sk-sk_protocol); if (ctx == NULL) { __qeth_free_new_skb(skb, new_skb); PRINT_WARN(could not create eddp context\n); @@ -6584,7 +6585,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, QETH_DBF_TEXT(trace,4,chgmaccb); cmd = (struct qeth_ipa_cmd *) data; - if (!card-options.layer2 || card-info.guestlan || + if (!card-options.layer2 || !(card-info.mac_bits QETH_LAYER2_MAC_READ)) { memcpy(card-dev-dev_addr, cmd-data.setadapterparms.data.change_addr.addr, diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index d518419..65ffc21 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -384,8 +384,6 @@ qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route, route-type = PRIMARY_CONNECTOR; } else if (!strcmp(tmp, secondary_connector)) { route-type = SECONDARY_CONNECTOR; - } else if (!strcmp(tmp, multicast_router)) { - route-type = MULTICAST_ROUTER; } else if (!strcmp(tmp, primary_router)) { route-type = PRIMARY_ROUTER; } else if (!strcmp(tmp, secondary_router)) { -- 1.5.1.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/5] s390: free skbs in finite amount of time in qeth
From: Ursula Braun [EMAIL PROTECTED] Free sent skbs in some finite amount of time. Affected are asynchronous queue of Hipersockets devices and the output queues of all eth-devices respectively. Signed-off-by: Ursula Braun [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/cio/qdio.c | 37 +++-- drivers/s390/cio/qdio.h |4 +++- drivers/s390/net/qeth_main.c | 14 -- include/asm-s390/qdio.h |1 + 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 05fac07..06bae6a 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -978,18 +978,25 @@ __qdio_outbound_processing(struct qdio_q *q) if (qdio_has_outbound_q_moved(q)) qdio_kick_outbound_handler(q); - if (q-is_iqdio_q) { + if (q-queue_type == QDIO_ZFCP_QFMT) { + if ((!q-hydra_gives_outbound_pcis) + (!qdio_is_outbound_q_done(q))) + qdio_mark_q(q); + } + else if (((!q-is_iqdio_q) (!q-is_pci_out)) || +(q-queue_type == QDIO_IQDIO_QFMT_ASYNCH)) { /* -* for asynchronous queues, we better check, if the sent -* buffer is already switched from PRIMED to EMPTY. +* make sure buffer switch from PRIMED to EMPTY is noticed +* and outbound_handler is called */ - if ((q-queue_type == QDIO_IQDIO_QFMT_ASYNCH) - !qdio_is_outbound_q_done(q)) - qdio_mark_q(q); - - } else if (!q-hydra_gives_outbound_pcis) - if (!qdio_is_outbound_q_done(q)) - qdio_mark_q(q); + if (qdio_is_outbound_q_done(q)) { + del_timer(q-timer); + } else { + if (!timer_pending(q-timer)) + mod_timer(q-timer, jiffies + + QDIO_FORCE_CHECK_TIMEOUT); + } + } qdio_release_q(q); } @@ -1830,6 +1837,7 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-queue_type = QDIO_IQDIO_QFMT_ASYNCH; q-int_parm=int_parm; q-is_input_q=0; + q-is_pci_out = 0; q-schid = irq_ptr-schid; q-cdev = cdev; q-irq_ptr = irq_ptr; @@ -1842,6 +1850,10 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-tasklet.data=(unsigned long)q; q-tasklet.func=(void(*)(unsigned long)) qdio_outbound_processing; + q-timer.function=(void(*)(unsigned long)) + qdio_outbound_processing; + q-timer.data = (long)q; + init_timer(q-timer); atomic_set(q-busy_siga_counter,0); q-timing.busy_start=0; @@ -2648,6 +2660,7 @@ qdio_shutdown(struct ccw_device *cdev, int how) for (i=0;iirq_ptr-no_output_qs;i++) { tasklet_kill(irq_ptr-output_qs[i]-tasklet); + del_timer(irq_ptr-output_qs[i]-timer); wait_event_interruptible_timeout(cdev-private-wait_q, !atomic_read(irq_ptr- output_qs[i]- @@ -3477,6 +3490,10 @@ do_qdio_handle_outbound(struct qdio_q *q, unsigned int callflags, } return; } + if (callflags QDIO_FLAG_PCI_OUT) + q-is_pci_out = 1; + else + q-is_pci_out = 0; if (q-is_iqdio_q) { /* one siga for every sbal */ while (count--) diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index ec9af72..6d0bcd2 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -60,6 +60,7 @@ #define QDIO_ACTIVATE_TIMEOUT ((5*HZ)10) #define QDIO_CLEANUP_CLEAR_TIMEOUT (20*HZ) #define QDIO_CLEANUP_HALT_TIMEOUT (10*HZ) +#define QDIO_FORCE_CHECK_TIMEOUT (10*HZ) enum qdio_irq_states { QDIO_IRQ_STATE_INACTIVE, @@ -489,8 +490,8 @@ struct qdio_q { void *irq_ptr; -#ifdef QDIO_USE_TIMERS_FOR_POLLING struct timer_list timer; +#ifdef QDIO_USE_TIMERS_FOR_POLLING atomic_t timer_already_set; spinlock_t timer_lock; #else /* QDIO_USE_TIMERS_FOR_POLLING */ @@ -536,6 +537,7 @@ struct qdio_q { } timing; atomic_t busy_siga_counter; unsigned int queue_type; + unsigned int is_pci_out; /* leave this member at the end. won't be cleared in qdio_fill_qs */ struct slib *slib; /* a page is allocated under this pointer, diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 54839fa..e0eb113 100644 --- a/drivers/s390/net/qeth_main.c
[PATCH 5/5] s390: qeth driver hardware specs adaptions
From: Peter Tiedemann [EMAIL PROTECTED] s390: qeth driver hardware specs adaptions - according to the latest OSA hardware specification incorporate actual IPA command and return codes into qeth. - whitespaces removed from qeth_mpc.h Signed-off-by: Peter Tiedemann [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- qeth_main.c | 26 +-- qeth_mpc.c | 101 +++ qeth_mpc.h | 219 ++-- 3 files changed, 247 insertions(+), 99 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 0d10ee0..6be98b1 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1615,6 +1615,21 @@ qeth_put_reply(struct qeth_reply *reply) kfree(reply); } +static void +qeth_issue_ipa_msg(struct qeth_ipa_cmd *cmd, struct qeth_card *card) +{ + int rc; + int com; + char * ipa_name; + + com = cmd-hdr.command; + rc = cmd-hdr.return_code; + ipa_name = qeth_get_ipa_cmd_name(com); + + PRINT_ERR(%s(x%X) for %s returned x%X \%s\\n, ipa_name, com, + QETH_CARD_IFNAME(card), rc, qeth_get_ipa_msg(rc)); +} + static struct qeth_ipa_cmd * qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) { @@ -1623,8 +1638,11 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) QETH_DBF_TEXT(trace,5,chkipad); if (IS_IPA(iob-data)){ cmd = (struct qeth_ipa_cmd *) PDU_ENCAPSULATION(iob-data); - if (IS_IPA_REPLY(cmd)) + if (IS_IPA_REPLY(cmd)) { + if (cmd-hdr.return_code) + qeth_issue_ipa_msg(cmd, card); return cmd; + } else { switch (cmd-hdr.command) { case IPA_CMD_STOPLAN: @@ -5883,9 +5901,6 @@ qeth_layer2_send_setmac_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (cmd-hdr.return_code) { QETH_DBF_TEXT_(trace, 2, L2er%x, cmd-hdr.return_code); - PRINT_WARN(Error in registering MAC address on \ - device %s: x%x\n, CARD_BUS_ID(card), - cmd-hdr.return_code); card-info.mac_bits = ~QETH_LAYER2_MAC_REGISTERED; cmd-hdr.return_code = -EIO; } else { @@ -5920,9 +5935,6 @@ qeth_layer2_send_delmac_cb(struct qeth_card *card, QETH_DBF_TEXT(trace, 2, L2Dmaccb); cmd = (struct qeth_ipa_cmd *) data; if (cmd-hdr.return_code) { - PRINT_WARN(Error in deregistering MAC address on \ - device %s: x%x\n, CARD_BUS_ID(card), - cmd-hdr.return_code); QETH_DBF_TEXT_(trace, 2, err%d, cmd-hdr.return_code); cmd-hdr.return_code = -EIO; return 0; diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c index 77c8320..f54fdfd 100644 --- a/drivers/s390/net/qeth_mpc.c +++ b/drivers/s390/net/qeth_mpc.c @@ -157,12 +157,113 @@ unsigned char READ_CCW[]={ }; +struct ipa_rc_msg { + enum qeth_ipa_return_codes rc; + char *msg; +}; +struct ipa_rc_msg qeth_ipa_rc_msg[] = { + {IPA_RC_SUCCESS,success}, + {IPA_RC_NOTSUPP,Command not supported}, + {IPA_RC_IP_TABLE_FULL, Add Addr IP Table Full - ipv6}, + {IPA_RC_UNKNOWN_ERROR, IPA command failed - reason unknown}, + {IPA_RC_UNSUPPORTED_COMMAND,Command not supported}, + {IPA_RC_DUP_IPV6_REMOTE,ipv6 address already registered remote}, + {IPA_RC_DUP_IPV6_HOME, ipv6 address already registered}, + {IPA_RC_UNREGISTERED_ADDR, Address not registered}, + {IPA_RC_NO_ID_AVAILABLE,No identifiers available}, + {IPA_RC_ID_NOT_FOUND, Identifier not found}, + {IPA_RC_INVALID_IP_VERSION, IP version incorrect}, + {IPA_RC_LAN_FRAME_MISMATCH, LAN and frame mismatch}, + {IPA_RC_L2_UNSUPPORTED_CMD, Unsupported layer 2 command}, + {IPA_RC_L2_DUP_MAC, Duplicate MAC address}, + {IPA_RC_L2_ADDR_TABLE_FULL, Layer2 address table full}, + {IPA_RC_L2_DUP_LAYER3_MAC, Duplicate with layer 3 MAC}, + {IPA_RC_L2_GMAC_NOT_FOUND, GMAC not found}, + {IPA_RC_L2_MAC_NOT_FOUND, L2 mac address not found}, + {IPA_RC_L2_INVALID_VLAN_ID, L2 invalid vlan id}, + {IPA_RC_L2_DUP_VLAN_ID, L2 duplicate vlan id}, + {IPA_RC_L2_VLAN_ID_NOT_FOUND, L2 vlan id not found}, + {IPA_RC_DATA_MISMATCH, Data field mismatch (v4/v6 mixed)}, + {IPA_RC_INVALID_MTU_SIZE, Invalid MTU size}, + {IPA_RC_INVALID_LANTYPE,Invalid LAN type}, + {IPA_RC_INVALID_LANNUM, Invalid LAN num
Re: [PATCH 3/5] s390: use kthread_run in qeth and lcs
On Mon, Apr 30, 2007 at 05:03:29PM +0100, Christoph Hellwig wrote: On Mon, Apr 30, 2007 at 05:42:57PM +0200, Frank Pavlic wrote: From: Eric Biederman [EMAIL PROTECTED] This patch modifies the qeth_recover thread to be started with kthread_run not a combination of kernel_thread and daemonize. Resulting in slightly simpler and more maintainable code. NACK, this is Eric's partial conversion which doesn't help much at all. In fact it might actually hurt by introducing unpaired kthread calls. Alright Christoph, thanks for clarifying this.. @Jeff, I'll send you another set without this one... Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] [AF_IUCV/IUCV]: net-2.6.22 fixes
Hi Dave, following three patches contain fixes for AF_IUCV socket support and for iucv, the base code for IUCV related actions in z/VM . I made these patches against net-2.6.22, but they should also apply to net-2.6 without any conflicts. Well it works on my copy :-). I will make another patchset for net-2.6 if you want me to do so. Thank you. Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/3] [AF_IUCV/IUCV]: Implementation of a skb backlog queue
From: Jennifer Hunt [EMAIL PROTECTED] With the inital implementation we missed to implement a skb backlog queue . The result is that socket receive processing tossed packets. Since AF_IUCV connections are working synchronously it leads to connection hangs. Problems with read, close and select also occured. Using a skb backlog queue is fixing all of these problems . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- include/net/iucv/af_iucv.h |2 net/iucv/af_iucv.c | 160 - 2 files changed, 133 insertions(+), 29 deletions(-) diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index 04d1abb..f9bd11b 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h @@ -28,6 +28,7 @@ enum { IUCV_LISTEN, IUCV_SEVERED, IUCV_DISCONN, + IUCV_CLOSING, IUCV_CLOSED }; @@ -62,6 +63,7 @@ struct iucv_sock { struct sock *parent; struct iucv_path*path; struct sk_buff_head send_skb_q; + struct sk_buff_head backlog_skb_q; unsigned intsend_tag; }; diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index acc9421..0c2e4a8 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -147,6 +147,7 @@ static void iucv_sock_close(struct sock *sk) unsigned char user_data[16]; struct iucv_sock *iucv = iucv_sk(sk); int err; + unsigned long timeo; iucv_sock_clear_timer(sk); lock_sock(sk); @@ -159,6 +160,21 @@ static void iucv_sock_close(struct sock *sk) case IUCV_CONNECTED: case IUCV_DISCONN: err = 0; + + sk-sk_state = IUCV_CLOSING; + sk-sk_state_change(sk); + + if(!skb_queue_empty(iucv-send_skb_q)) { + if (sock_flag(sk, SOCK_LINGER) sk-sk_lingertime) + timeo = sk-sk_lingertime; + else + timeo = IUCV_DISCONN_TIMEOUT; + err = iucv_sock_wait_state(sk, IUCV_CLOSED, 0, timeo); + } + + sk-sk_state = IUCV_CLOSED; + sk-sk_state_change(sk); + if (iucv-path) { low_nmcpy(user_data, iucv-src_name); high_nmcpy(user_data, iucv-dst_name); @@ -168,12 +184,11 @@ static void iucv_sock_close(struct sock *sk) iucv-path = NULL; } - sk-sk_state = IUCV_CLOSED; - sk-sk_state_change(sk); sk-sk_err = ECONNRESET; sk-sk_state_change(sk); skb_queue_purge(iucv-send_skb_q); + skb_queue_purge(iucv-backlog_skb_q); sock_set_flag(sk, SOCK_ZAPPED); break; @@ -204,6 +219,7 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio) sock_init_data(sock, sk); INIT_LIST_HEAD(iucv_sk(sk)-accept_q); skb_queue_head_init(iucv_sk(sk)-send_skb_q); + skb_queue_head_init(iucv_sk(sk)-backlog_skb_q); iucv_sk(sk)-send_tag = 0; sk-sk_destruct = iucv_sock_destruct; @@ -510,7 +526,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, long timeo; int err = 0; - lock_sock(sk); + lock_sock_nested(sk, SINGLE_DEPTH_NESTING); if (sk-sk_state != IUCV_LISTEN) { err = -EBADFD; @@ -530,7 +546,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, release_sock(sk); timeo = schedule_timeout(timeo); - lock_sock(sk); + lock_sock_nested(sk, SINGLE_DEPTH_NESTING); if (sk-sk_state != IUCV_LISTEN) { err = -EBADFD; @@ -606,7 +622,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, if(!(skb = sock_alloc_send_skb(sk, len, msg-msg_flags MSG_DONTWAIT, err))) - return err; + goto out; if (memcpy_fromiovec(skb_put(skb, len), msg-msg_iov, len)){ err = -EFAULT; @@ -647,10 +663,16 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, { int noblock = flags MSG_DONTWAIT; struct sock *sk = sock-sk; + struct iucv_sock *iucv = iucv_sk(sk); int target, copied = 0; - struct sk_buff *skb; + struct sk_buff *skb, *rskb, *cskb; int err = 0; + if ((sk-sk_state == IUCV_DISCONN || sk-sk_state == IUCV_SEVERED) + skb_queue_empty(iucv-backlog_skb_q) + skb_queue_empty(sk-sk_receive_queue)) + return 0; + if (flags (MSG_OOB)) return -EOPNOTSUPP; @@ -665,10 +687,12 @@ static int
[PATCH 3/3] [AF_IUCV/IUCV]: Add missing section annotations
From: Heiko Carstens [EMAIL PROTECTED] Add missing section annotations and found and fixed some Coding Style issues. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- af_iucv.c | 44 +++- iucv.c| 49 ++--- 2 files changed, 45 insertions(+), 48 deletions(-) diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 0c2e4a8..7f1672d 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -45,7 +45,8 @@ static struct proto iucv_proto = { static void iucv_callback_rx(struct iucv_path *, struct iucv_message *); static void iucv_callback_txdone(struct iucv_path *, struct iucv_message *); static void iucv_callback_connack(struct iucv_path *, u8 ipuser[16]); -static int iucv_callback_connreq(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); +static int iucv_callback_connreq(struct iucv_path *, u8 ipvmid[8], +u8 ipuser[16]); static void iucv_callback_connrej(struct iucv_path *, u8 ipuser[16]); static struct iucv_sock_list iucv_sk_list = { @@ -152,7 +153,7 @@ static void iucv_sock_close(struct sock *sk) iucv_sock_clear_timer(sk); lock_sock(sk); - switch(sk-sk_state) { + switch (sk-sk_state) { case IUCV_LISTEN: iucv_sock_cleanup_listen(sk); break; @@ -164,7 +165,7 @@ static void iucv_sock_close(struct sock *sk) sk-sk_state = IUCV_CLOSING; sk-sk_state_change(sk); - if(!skb_queue_empty(iucv-send_skb_q)) { + if (!skb_queue_empty(iucv-send_skb_q)) { if (sock_flag(sk, SOCK_LINGER) sk-sk_lingertime) timeo = sk-sk_lingertime; else @@ -292,7 +293,7 @@ struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock) struct iucv_sock *isk, *n; struct sock *sk; - list_for_each_entry_safe(isk, n, iucv_sk(parent)-accept_q, accept_q){ + list_for_each_entry_safe(isk, n, iucv_sk(parent)-accept_q, accept_q) { sk = (struct sock *) isk; lock_sock(sk); @@ -537,7 +538,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock, /* Wait for an incoming connection */ add_wait_queue_exclusive(sk-sk_sleep, wait); - while (!(nsk = iucv_accept_dequeue(sk, newsock))){ + while (!(nsk = iucv_accept_dequeue(sk, newsock))) { set_current_state(TASK_INTERRUPTIBLE); if (!timeo) { err = -EAGAIN; @@ -618,13 +619,13 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, goto out; } - if (sk-sk_state == IUCV_CONNECTED){ - if(!(skb = sock_alloc_send_skb(sk, len, - msg-msg_flags MSG_DONTWAIT, - err))) + if (sk-sk_state == IUCV_CONNECTED) { + if (!(skb = sock_alloc_send_skb(sk, len, + msg-msg_flags MSG_DONTWAIT, + err))) goto out; - if (memcpy_fromiovec(skb_put(skb, len), msg-msg_iov, len)){ + if (memcpy_fromiovec(skb_put(skb, len), msg-msg_iov, len)) { err = -EFAULT; goto fail; } @@ -710,7 +711,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, /* Queue backlog skbs */ rskb = skb_dequeue(iucv_sk(sk)-backlog_skb_q); - while(rskb) { + while (rskb) { if (sock_queue_rcv_skb(sk, rskb)) { skb_queue_head(iucv_sk(sk)-backlog_skb_q, rskb); @@ -731,7 +732,7 @@ static inline unsigned int iucv_accept_poll(struct sock *parent) struct iucv_sock *isk, *n; struct sock *sk; - list_for_each_entry_safe(isk, n, iucv_sk(parent)-accept_q, accept_q){ + list_for_each_entry_safe(isk, n, iucv_sk(parent)-accept_q, accept_q) { sk = (struct sock *) isk; if (sk-sk_state == IUCV_CONNECTED) @@ -762,7 +763,7 @@ unsigned int iucv_sock_poll(struct file *file, struct socket *sock, mask |= POLLHUP; if (!skb_queue_empty(sk-sk_receive_queue) || - (sk-sk_shutdown RCV_SHUTDOWN)) + (sk-sk_shutdown RCV_SHUTDOWN)) mask |= POLLIN | POLLRDNORM; if (sk-sk_state == IUCV_CLOSED) @@ -793,7 +794,7 @@ static int iucv_sock_shutdown(struct socket *sock, int how) return -EINVAL; lock_sock(sk); - switch(sk-sk_state) { + switch (sk-sk_state) { case IUCV_CLOSED: err = -ENOTCONN; goto fail; @@ -809,7 +810,7
[PATCH 1/3] [AF_IUCV/IUCV]: smp_call_function deadlock
From: Martin Schwidefsky [EMAIL PROTECTED] From: Heiko Carstens [EMAIL PROTECTED] From: Ursula Braun [EMAIL PROTECTED] Calling smp_call_function can lead to a deadlock if it is called from tasklet context. Fixing this deadlock requires to move the smp_call_function from the tasklet context to a work queue. To do that queue the path pending interrupts to a separate list and move the path cleanup out of iucv_path_sever to iucv_path_connect and iucv_path_pending. This creates a new requirement for iucv_path_connect: it may not be called from tasklet context anymore. Also fixed compile problem for CONFIG_HOTPLUG_CPU=n and another one when walking the cpu_online mask. When doing this, we must disable cpu hotplug. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- include/net/iucv/iucv.h |2 net/iucv/iucv.c | 207 ++-- 2 files changed, 133 insertions(+), 76 deletions(-) diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index 746e741..fd70adb 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h @@ -16,7 +16,7 @@ * completed a register, it can exploit the other functions. * For furthur reference on all IUCV functionality, refer to the * CP Programming Services book, also available on the web thru - * www.ibm.com/s390/vm/pubs, manual # SC24-5760 + * www.vm.ibm.com/pubs, manual # SC24-6084 * * Definition of Return Codes * - All positive return codes including zero are reflected back diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 1b10d57..903bdb6 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -90,20 +90,43 @@ struct iucv_irq_data { u32 res2[8]; }; -struct iucv_work { +struct iucv_irq_list { struct list_head list; struct iucv_irq_data data; }; -static LIST_HEAD(iucv_work_queue); -static DEFINE_SPINLOCK(iucv_work_lock); - static struct iucv_irq_data *iucv_irq_data; static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE; static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE; -static void iucv_tasklet_handler(unsigned long); -static DECLARE_TASKLET(iucv_tasklet, iucv_tasklet_handler,0); +/* + * Queue of interrupt buffers lock for delivery via the tasklet + * (fast but can't call smp_call_function). + */ +static LIST_HEAD(iucv_task_queue); + +/* + * The tasklet for fast delivery of iucv interrupts. + */ +static void iucv_tasklet_fn(unsigned long); +static DECLARE_TASKLET(iucv_tasklet, iucv_tasklet_fn,0); + +/* + * Queue of interrupt buffers for delivery via a work queue + * (slower but can call smp_call_function). + */ +static LIST_HEAD(iucv_work_queue); + +/* + * The work element to deliver path pending interrupts. + */ +static void iucv_work_fn(struct work_struct *work); +static DECLARE_WORK(iucv_work, iucv_work_fn); + +/* + * Spinlock protecting task and work queue. + */ +static DEFINE_SPINLOCK(iucv_queue_lock); enum iucv_command_codes { IUCV_QUERY = 0, @@ -147,10 +170,10 @@ static unsigned long iucv_max_pathid; static DEFINE_SPINLOCK(iucv_table_lock); /* - * iucv_tasklet_cpu: contains the number of the cpu executing the tasklet. - * Needed for iucv_path_sever called from tasklet. + * iucv_active_cpu: contains the number of the cpu executing the tasklet + * or the work handler. Needed for iucv_path_sever called from tasklet. */ -static int iucv_tasklet_cpu = -1; +static int iucv_active_cpu = -1; /* * Mutex and wait queue for iucv_register/iucv_unregister. @@ -449,17 +472,19 @@ static void iucv_setmask_mp(void) { int cpu; + preempt_disable(); for_each_online_cpu(cpu) /* Enable all cpus with a declared buffer. */ if (cpu_isset(cpu, iucv_buffer_cpumask) !cpu_isset(cpu, iucv_irq_cpumask)) smp_call_function_on(iucv_allow_cpu, NULL, 0, 1, cpu); + preempt_enable(); } /** * iucv_setmask_up * - * Allow iucv interrupts on a single cpus. + * Allow iucv interrupts on a single cpu. */ static void iucv_setmask_up(void) { @@ -493,8 +518,10 @@ static int iucv_enable(void) goto out; /* Declare per cpu buffers. */ rc = -EIO; + preempt_disable(); for_each_online_cpu(cpu) smp_call_function_on(iucv_declare_cpu, NULL, 0, 1, cpu); + preempt_enable(); if (cpus_empty(iucv_buffer_cpumask)) /* No cpu could declare an iucv buffer. */ goto out_path; @@ -519,7 +546,6 @@ static void iucv_disable(void) kfree(iucv_path_table); } -#ifdef CONFIG_HOTPLUG_CPU static int __cpuinit iucv_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { @@ -565,7 +591,6 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self, static struct notifier_block iucv_cpu_notifier = { .notifier_call = iucv_cpu_notify, }; -#endif
Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
On Thu, Feb 08, 2007 at 02:00:22PM -0800, David Miller wrote: From: Frank Pavlic [EMAIL PROTECTED] Date: Fri, 2 Feb 2007 13:05:28 +0100 The patch set consists of following patches: [1/7] [S390]: Rewrite of the IUCV base code, part 1 [2/7] [S390]: Rewrite of the IUCV base code, part 2 [3/7] [S390]: Adapt monreader driver to new IUCV API [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API [5/7] [S390]: Adapt netiucv driver to new IUCV API [6/7] [S390]: Adapt special message interface to new IUCV API [7/7] [S390]: Add AF_IUCV socket support I've applied all of this, although some of the driver conversions (notable, patches #5 and #6) didn't apply cleanly so I applied them by hand. Thanks for this , I figured that out today by myself and started to make a new set of patches. You saved me a lot of time and work once again ;-) Watch out for any fallout from this when Linus pulls these changes in. Thanks. I'll do so ... - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote: From: Frank Pavlic [EMAIL PROTECTED] Date: Fri, 2 Feb 2007 13:05:28 +0100 The patch set consists of following patches: [1/7] [S390]: Rewrite of the IUCV base code, part 1 [2/7] [S390]: Rewrite of the IUCV base code, part 2 [3/7] [S390]: Adapt monreader driver to new IUCV API [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API [5/7] [S390]: Adapt netiucv driver to new IUCV API [6/7] [S390]: Adapt special message interface to new IUCV API [7/7] [S390]: Add AF_IUCV socket support I have no fundamental objections to this, although I think I'll end up needing something similar on Niagara at some point :-) The list ate the first patch due to it's size. Could you email me a copy privately so can integrate all of your work into my net-2.6.21 tree? Thanks. - Dave, Really good news for me, I just have started to split the first patch :-) Thank you I send you a copy privately... Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote: From: Frank Pavlic [EMAIL PROTECTED] Date: Fri, 2 Feb 2007 13:05:28 +0100 The patch set consists of following patches: [1/7] [S390]: Rewrite of the IUCV base code, part 1 [2/7] [S390]: Rewrite of the IUCV base code, part 2 [3/7] [S390]: Adapt monreader driver to new IUCV API [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API [5/7] [S390]: Adapt netiucv driver to new IUCV API [6/7] [S390]: Adapt special message interface to new IUCV API [7/7] [S390]: Add AF_IUCV socket support I have no fundamental objections to this, although I think I'll end up needing something similar on Niagara at some point :-) I guess there are and will be more than two guys needing such a vehicle. With all the virtualization support in Linux we have right now and the stuff which will come in the future IMO we will need some kind of a generic inter-communication infrastructure (what a wording :-) ) in Linux . The list ate the first patch due to it's size. Could you email me a copy privately so can integrate all of your work into my net-2.6.21 tree? Thanks. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RESEND PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
Hello, seems that Patch 1/7 is lost and did not make its way to the mailing list :-( That's the reason why I resend the whole patch set again. Here we go ... The Inter-User Communication Vehicle (IUCV) is a z/VM communication facility that enables a program running in one virtual machine to communicate with another virtual machine, or with a control program, or even with itself. The communication takes place over a predefined linkage called a path. AF_IUCV provides a complete socket interface for socket communication from Linux to Linux (running on z/VM) or Linux on VM to CMS. The AF_IUCV Protocol Support will use IUCV to provide AF_IUCV protocol support for communication with z/VM back-end services. It also can connect socket applications operating in Linux kernels running on different VM user IDs, or to connect a Linux application to another socket application running in a VM guest. AF_IUCV is using a different addressing scheme and therefore there is no chance to use existing drivers like netiucv for such functionality. The patch set consists of following patches: [1/7] [S390]: Rewrite of the IUCV base code, part 1 [2/7] [S390]: Rewrite of the IUCV base code, part 2 [3/7] [S390]: Adapt monreader driver to new IUCV API [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API [5/7] [S390]: Adapt netiucv driver to new IUCV API [6/7] [S390]: Adapt special message interface to new IUCV API [7/7] [S390]: Add AF_IUCV socket support Basically it will remove the old IUCV base code from drivers/s390/net, adds the new rewritten one to net/iucv. Then all iucv based device drivers like monreader, vmlogrdr, netiucv and special message interface will be adapted to the new IUCV API. The last patch then adds the AF_IUCV socket support residing in net/iucv either. I am asking for integration now and of course code review comments and suggestions are very appreciated . Thank you very much Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/7] [S390]: Adapt special message interface to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt special message interface to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/net/smsgiucv.c | 147 ++- 1 files changed, 74 insertions(+), 73 deletions(-) diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index b8179c2..3ccca58 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -1,7 +1,7 @@ /* * IUCV special message driver * - * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Copyright 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Martin Schwidefsky ([EMAIL PROTECTED]) * * This program is free software; you can redistribute it and/or modify @@ -23,10 +23,10 @@ #include linux/module.h #include linux/init.h #include linux/errno.h #include linux/device.h +#include net/iucv/iucv.h #include asm/cpcmd.h #include asm/ebcdic.h - -#include iucv.h +#include smsgiucv.h struct smsg_callback { struct list_head list; @@ -39,38 +39,46 @@ MODULE_AUTHOR ((C) 2003 IBM Corporation by Martin Schwidefsky ([EMAIL PROTECTED])); MODULE_DESCRIPTION (Linux for S/390 IUCV special message driver); -static iucv_handle_t smsg_handle; -static unsigned short smsg_pathid; +static struct iucv_path *smsg_path; + static DEFINE_SPINLOCK(smsg_list_lock); static struct list_head smsg_list = LIST_HEAD_INIT(smsg_list); -static void -smsg_connection_complete(iucv_ConnectionComplete *eib, void *pgm_data) +static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); +static void smsg_message_pending(struct iucv_path *, struct iucv_message *); + +static struct iucv_handler smsg_handler = { + .path_pending= smsg_path_pending, + .message_pending = smsg_message_pending, +}; + +static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], +u8 ipuser[16]) { + if (strncmp(ipvmid, *MSG, sizeof(ipvmid)) != 0) + return -EINVAL; + /* Path pending from *MSG. */ + return iucv_path_accept(path, smsg_handler, SMSGIUCV, NULL); } - -static void -smsg_message_pending(iucv_MessagePending *eib, void *pgm_data) +static void smsg_message_pending(struct iucv_path *path, +struct iucv_message *msg) { struct smsg_callback *cb; - unsigned char *msg; + unsigned char *buffer; unsigned char sender[9]; - unsigned short len; int rc, i; - len = eib-ln1msg2.ipbfln1f; - msg = kmalloc(len + 1, GFP_ATOMIC|GFP_DMA); - if (!msg) { - iucv_reject(eib-ippathid, eib-ipmsgid, eib-iptrgcls); + buffer = kmalloc(msg-length + 1, GFP_ATOMIC | GFP_DMA); + if (!buffer) { + iucv_message_reject(path, msg); return; } - rc = iucv_receive(eib-ippathid, eib-ipmsgid, eib-iptrgcls, - msg, len, NULL, NULL, NULL); + rc = iucv_message_receive(path, msg, 0, buffer, msg-length, NULL); if (rc == 0) { - msg[len] = 0; - EBCASC(msg, len); - memcpy(sender, msg, 8); + buffer[msg-length] = 0; + EBCASC(buffer, msg-length); + memcpy(sender, buffer, 8); sender[8] = 0; /* Remove trailing whitespace from the sender name. */ for (i = 7; i = 0; i--) { @@ -80,27 +88,17 @@ smsg_message_pending(iucv_MessagePending } spin_lock(smsg_list_lock); list_for_each_entry(cb, smsg_list, list) - if (strncmp(msg + 8, cb-prefix, cb-len) == 0) { - cb-callback(sender, msg + 8); + if (strncmp(buffer + 8, cb-prefix, cb-len) == 0) { + cb-callback(sender, buffer + 8); break; } spin_unlock(smsg_list_lock); } - kfree(msg); + kfree(buffer); } -static iucv_interrupt_ops_t smsg_ops = { - .ConnectionComplete = smsg_connection_complete, - .MessagePending = smsg_message_pending, -}; - -static struct device_driver smsg_driver = { - .name = SMSGIUCV, - .bus = iucv_bus, -}; - -int -smsg_register_callback(char *prefix, void (*callback)(char *from, char *str)) +int smsg_register_callback(char *prefix, + void (*callback)(char *from, char *str)) { struct smsg_callback *cb; @@ -110,18 +108,18 @@ smsg_register_callback(char *prefix, voi cb-prefix = prefix; cb-len = strlen(prefix); cb-callback = callback; - spin_lock(smsg_list_lock); + spin_lock_bh(smsg_list_lock); list_add_tail(cb-list, smsg_list); - spin_unlock(smsg_list_lock); + spin_unlock_bh(smsg_list_lock
[PATCH 3/7] [S390]: Adapt monreader driver to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt monreader character device driver to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/char/monreader.c | 218 +++-- 1 files changed, 101 insertions(+), 117 deletions(-) diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index a138b15..3a1a958 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -3,7 +3,7 @@ * * Character device driver for reading z/VM *MONITOR service records. * - * Copyright (C) 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH. + * Copyright 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH. * * Author: Gerald Schaefer [EMAIL PROTECTED] */ @@ -22,7 +22,7 @@ #include asm/uaccess.h #include asm/ebcdic.h #include asm/extmem.h #include linux/poll.h -#include ../net/iucv.h +#include net/iucv/iucv.h //#define MON_DEBUG/* Debug messages on/off */ @@ -50,14 +50,13 @@ static char mon_dcss_name[9] = MONDCSS\ struct mon_msg { u32 pos; u32 mca_offset; - iucv_MessagePending local_eib; + struct iucv_message msg; char msglim_reached; char replied_msglim; }; struct mon_private { - u16 pathid; - iucv_handle_t iucv_handle; + struct iucv_path *path; struct mon_msg *msg_array[MON_MSGLIM]; unsigned int write_index; unsigned int read_index; @@ -75,8 +74,6 @@ static unsigned long mon_dcss_end; static DECLARE_WAIT_QUEUE_HEAD(mon_read_wait_queue); static DECLARE_WAIT_QUEUE_HEAD(mon_conn_wait_queue); -static u8 iucv_host[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - static u8 user_data_connect[16] = { /* Version code, must be 0x01 for shared mode */ 0x01, @@ -100,8 +97,7 @@ static u8 user_data_sever[16] = { * Create the 8 bytes EBCDIC DCSS segment name from * an ASCII name, incl. padding */ -static inline void -dcss_mkname(char *ascii_name, char *ebcdic_name) +static inline void dcss_mkname(char *ascii_name, char *ebcdic_name) { int i; @@ -119,8 +115,7 @@ dcss_mkname(char *ascii_name, char *ebcd * print appropriate error message for segment_load()/segment_type() * return code */ -static void -mon_segment_warn(int rc, char* seg_name) +static void mon_segment_warn(int rc, char* seg_name) { switch (rc) { case -ENOENT: @@ -166,44 +161,37 @@ mon_segment_warn(int rc, char* seg_name) } } -static inline unsigned long -mon_mca_start(struct mon_msg *monmsg) +static inline unsigned long mon_mca_start(struct mon_msg *monmsg) { - return monmsg-local_eib.ln1msg1.iprmmsg1_u32; + return *(u32 *) monmsg-msg.rmmsg; } -static inline unsigned long -mon_mca_end(struct mon_msg *monmsg) +static inline unsigned long mon_mca_end(struct mon_msg *monmsg) { - return monmsg-local_eib.ln1msg2.ipbfln1f; + return *(u32 *) monmsg-msg.rmmsg[4]; } -static inline u8 -mon_mca_type(struct mon_msg *monmsg, u8 index) +static inline u8 mon_mca_type(struct mon_msg *monmsg, u8 index) { return *((u8 *) mon_mca_start(monmsg) + monmsg-mca_offset + index); } -static inline u32 -mon_mca_size(struct mon_msg *monmsg) +static inline u32 mon_mca_size(struct mon_msg *monmsg) { return mon_mca_end(monmsg) - mon_mca_start(monmsg) + 1; } -static inline u32 -mon_rec_start(struct mon_msg *monmsg) +static inline u32 mon_rec_start(struct mon_msg *monmsg) { return *((u32 *) (mon_mca_start(monmsg) + monmsg-mca_offset + 4)); } -static inline u32 -mon_rec_end(struct mon_msg *monmsg) +static inline u32 mon_rec_end(struct mon_msg *monmsg) { return *((u32 *) (mon_mca_start(monmsg) + monmsg-mca_offset + 8)); } -static inline int -mon_check_mca(struct mon_msg *monmsg) +static inline int mon_check_mca(struct mon_msg *monmsg) { if ((mon_rec_end(monmsg) = mon_rec_start(monmsg)) || (mon_rec_start(monmsg) mon_dcss_start) || @@ -221,20 +209,17 @@ mon_check_mca(struct mon_msg *monmsg) return 0; } -static inline int -mon_send_reply(struct mon_msg *monmsg, struct mon_private *monpriv) +static inline int mon_send_reply(struct mon_msg *monmsg, +struct mon_private *monpriv) { - u8 prmmsg[8]; int rc; P_DEBUG(read, REPLY: pathid = 0x%04X, msgid = 0x%08X, trgcls = 0x%08X\n\n, - monmsg-local_eib.ippathid, monmsg-local_eib.ipmsgid, - monmsg-local_eib.iptrgcls); - rc = iucv_reply_prmmsg(monmsg-local_eib.ippathid, - monmsg-local_eib.ipmsgid, - monmsg-local_eib.iptrgcls, - 0, prmmsg); + monpriv-path-pathid, monmsg-msg.id, monmsg-msg.class); + + rc = iucv_message_reply(monpriv-path, monmsg-msg
[PATCH 7/7] [S390]: Add AF_IUCV socket support
From: Jennifer Hunt[EMAIL PROTECTED] This patch adds AF_IUCV socket support. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/defconfig|1 include/linux/net.h|2 include/linux/socket.h |4 include/net/iucv/af_iucv.h | 106 net/iucv/Kconfig |8 net/iucv/Makefile |1 net/iucv/af_iucv.c | 1077 7 files changed, 1197 insertions(+), 2 deletions(-) diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 56fe005..11a8049 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig @@ -178,6 +178,7 @@ # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set CONFIG_NET_KEY=y CONFIG_IUCV=m +CONFIG_AFIUCV=m CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set diff --git a/include/linux/net.h b/include/linux/net.h index f28d8a2..4db21e6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -24,7 +24,7 @@ #include asm/socket.h struct poll_table_struct; struct inode; -#define NPROTO 32 /* should be enough for now.. */ +#define NPROTO 33 /* should be enough for now.. */ #define SYS_SOCKET 1 /* sys_socket(2)*/ #define SYS_BIND 2 /* sys_bind(2) */ diff --git a/include/linux/socket.h b/include/linux/socket.h index 92cd38e..fcd35a2 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -187,7 +187,8 @@ #define AF_WANPIPE 25 /* Wanpipe API Soc #define AF_LLC 26 /* Linux LLC*/ #define AF_TIPC30 /* TIPC sockets */ #define AF_BLUETOOTH 31 /* Bluetooth sockets*/ -#define AF_MAX 32 /* For now.. */ +#define AF_IUCV32 /* IUCV sockets */ +#define AF_MAX 33 /* For now.. */ /* Protocol families, same as address families. */ #define PF_UNSPEC AF_UNSPEC @@ -220,6 +221,7 @@ #define PF_WANPIPE AF_WANPIPE #define PF_LLC AF_LLC #define PF_TIPCAF_TIPC #define PF_BLUETOOTH AF_BLUETOOTH +#define PF_IUCVAF_IUCV #define PF_MAX AF_MAX /* Maximum queue length specifiable by listen. */ diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h new file mode 100644 index 000..04d1abb --- /dev/null +++ b/include/net/iucv/af_iucv.h @@ -0,0 +1,106 @@ +/* + * Copyright 2006 IBM Corporation + * IUCV protocol stack for Linux on zSeries + * Version 1.0 + * Author(s): Jennifer Hunt [EMAIL PROTECTED] + * + */ + +#ifndef __AFIUCV_H +#define __AFIUCV_H + +#include asm/types.h +#include asm/byteorder.h +#include linux/list.h +#include linux/poll.h +#include linux/socket.h + +#ifndef AF_IUCV +#define AF_IUCV32 +#define PF_IUCVAF_IUCV +#endif + +/* Connection and socket states */ +enum { + IUCV_CONNECTED = 1, + IUCV_OPEN, + IUCV_BOUND, + IUCV_LISTEN, + IUCV_SEVERED, + IUCV_DISCONN, + IUCV_CLOSED +}; + +#define IUCV_QUEUELEN_DEFAULT 65535 +#define IUCV_CONN_TIMEOUT (HZ * 40) +#define IUCV_DISCONN_TIMEOUT (HZ * 2) +#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) +#define IUCV_BUFSIZE_DEFAULT 32768 + +/* IUCV socket address */ +struct sockaddr_iucv { + sa_family_t siucv_family; + unsigned short siucv_port; /* Reserved */ + unsigned intsiucv_addr; /* Reserved */ + charsiucv_nodeid[8];/* Reserved */ + charsiucv_user_id[8]; /* Guest User Id */ + charsiucv_name[8]; /* Application Name */ +}; + + +/* Common socket structures and functions */ + +#define iucv_sk(__sk) ((struct iucv_sock *) __sk) + +struct iucv_sock { + struct sock sk; + charsrc_user_id[8]; + charsrc_name[8]; + chardst_user_id[8]; + chardst_name[8]; + struct list_headaccept_q; + struct sock *parent; + struct iucv_path*path; + struct sk_buff_head send_skb_q; + unsigned intsend_tag; +}; + +struct iucv_sock_list { + struct hlist_head head; + rwlock_t lock; + atomic_t autobind_name; +}; + +static void iucv_sock_destruct(struct sock *sk); +static void iucv_sock_cleanup_listen(struct sock *parent); +static void iucv_sock_kill(struct sock *sk); +static void iucv_sock_close(struct sock *sk); +static int iucv_sock_create(struct socket *sock, int proto); +static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr, + int addr_len); +static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr, + int alen, int
[PATCH 4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt vmlogrdr character device driver to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/char/vmlogrdr.c | 284 +++--- 1 files changed, 129 insertions(+), 155 deletions(-) diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 6cb2304..8432a76 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -3,7 +3,7 @@ * character device driver for reading z/VM system service records * * - * Copyright (C) 2004 IBM Corporation + * Copyright 2004 IBM Corporation * character device driver for reading z/VM system service records, * Version 1.0 * Author(s): Xenia Tkatschow [EMAIL PROTECTED] @@ -21,7 +21,7 @@ #include asm/uaccess.h #include asm/cpcmd.h #include asm/debug.h #include asm/ebcdic.h -#include ../net/iucv.h +#include net/iucv/iucv.h #include linux/kmod.h #include linux/cdev.h #include linux/device.h @@ -60,12 +60,11 @@ struct vmlogrdr_priv_t { char system_service[8]; char internal_name[8]; char recording_name[8]; - u16 pathid; + struct iucv_path *path; int connection_established; int iucv_path_severed; - iucv_MessagePending local_interrupt_buffer; + struct iucv_message local_interrupt_buffer; atomic_t receive_ready; - iucv_handle_t iucv_handle; int minor_num; char * buffer; char * current_position; @@ -97,40 +96,21 @@ static struct file_operations vmlogrdr_f }; -static u8 iucvMagic[16] = { - 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 -}; +static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 ipuser[16]); +static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 ipuser[16]); +static void vmlogrdr_iucv_message_pending(struct iucv_path *, + struct iucv_message *); -static u8 mask[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +static struct iucv_handler vmlogrdr_iucv_handler = { + .path_complete = vmlogrdr_iucv_path_complete, + .path_severed= vmlogrdr_iucv_path_severed, + .message_pending = vmlogrdr_iucv_message_pending, }; -static u8 iucv_host[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - -static void -vmlogrdr_iucv_ConnectionComplete(iucv_ConnectionComplete *eib, void *pgm_data); -static void -vmlogrdr_iucv_ConnectionSevered(iucv_ConnectionSevered *eib, void *pgm_data); -static void -vmlogrdr_iucv_MessagePending(iucv_MessagePending *eib, void *pgm_data); - - -static iucv_interrupt_ops_t vmlogrdr_iucvops = { - .ConnectionComplete = vmlogrdr_iucv_ConnectionComplete, - .ConnectionSevered = vmlogrdr_iucv_ConnectionSevered, - .MessagePending = vmlogrdr_iucv_MessagePending, -}; - - -DECLARE_WAIT_QUEUE_HEAD(conn_wait_queue); -DECLARE_WAIT_QUEUE_HEAD(read_wait_queue); +static DECLARE_WAIT_QUEUE_HEAD(conn_wait_queue); +static DECLARE_WAIT_QUEUE_HEAD(read_wait_queue); /* * pointer to system service private structure @@ -177,28 +157,29 @@ static struct cdev *vmlogrdr_cdev = NUL static int recording_class_AB; -static void -vmlogrdr_iucv_ConnectionComplete (iucv_ConnectionComplete * eib, - void * pgm_data) +static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 ipuser[16]) { - struct vmlogrdr_priv_t * logptr = pgm_data; + struct vmlogrdr_priv_t * logptr = path-private; + spin_lock(logptr-priv_lock); logptr-connection_established = 1; spin_unlock(logptr-priv_lock); wake_up(conn_wait_queue); - return; } -static void -vmlogrdr_iucv_ConnectionSevered (iucv_ConnectionSevered * eib, void * pgm_data) +static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 ipuser[16]) { - u8 reason = (u8) eib-ipuser[8]; - struct vmlogrdr_priv_t * logptr = pgm_data; + struct vmlogrdr_priv_t * logptr = path-private; + u8 reason = (u8) ipuser[8]; printk (KERN_ERR vmlogrdr: connection severed with reason %i\n, reason); + iucv_path_sever(path, NULL); + kfree(path); + logptr-path = NULL; + spin_lock(logptr-priv_lock); logptr-connection_established = 0; logptr-iucv_path_severed = 1; @@ -210,10 +191,10 @@ vmlogrdr_iucv_ConnectionSevered (iucv_Co } -static void -vmlogrdr_iucv_MessagePending (iucv_MessagePending * eib, void * pgm_data) +static void vmlogrdr_iucv_message_pending(struct iucv_path *path, + struct iucv_message *msg) { - struct vmlogrdr_priv_t * logptr
[PATCH 1/7] too big ??
Hi, I realized that PATCH 1/7 of the AF_IUCV patch set is more than 100kb . Seems that this is too much for the mailing list. Well since I resent them some minutes ago I am wondering what would be the best way now to get PATCH 1/7 onto netdev . Shall I only send the splitted PATCH 1/7 or really another RESEND of the whole AF_IUCV patch set ? Thanks Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support
Hello, The Inter-User Communication Vehicle (IUCV) is a z/VM communication facility that enables a program running in one virtual machine to communicate with another virtual machine, or with a control program, or even with itself. The communication takes place over a predefined linkage called a path. AF_IUCV provides a complete socket interface for socket communication from Linux to Linux (running on z/VM) or Linux on VM to CMS. The AF_IUCV Protocol Support will use IUCV to provide AF_IUCV protocol support for communication with z/VM back-end services. It also can connect socket applications operating in Linux kernels running on different VM user IDs, or to connect a Linux application to another socket application running in a VM guest. AF_IUCV is using a different addressing scheme and therefore there is no chance to use existing drivers like netiucv for such functionality. The patch set consists of following patches: [1/7] [S390]: Rewrite of the IUCV base code, part 1 [2/7] [S390]: Rewrite of the IUCV base code, part 2 [3/7] [S390]: Adapt monreader driver to new IUCV API [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API [5/7] [S390]: Adapt netiucv driver to new IUCV API [6/7] [S390]: Adapt special message interface to new IUCV API [7/7] [S390]: Add AF_IUCV socket support Basically it will remove the old IUCV base code from drivers/s390/net, adds the new rewritten one to net/iucv. Then all iucv based device drivers like monreader, vmlogrdr, netiucv and special message interface will be adapted to the new IUCV API. The last patch then adds the AF_IUCV socket support residing in net/iucv either. I am asking for integration now and of course code review comments and suggestions are very appreciated . Thank you very much Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/7] [S390]: Adapt special message interface to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt special message interface to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/net/smsgiucv.c | 147 ++- 1 files changed, 74 insertions(+), 73 deletions(-) diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index b8179c2..3ccca58 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -1,7 +1,7 @@ /* * IUCV special message driver * - * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Copyright 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Martin Schwidefsky ([EMAIL PROTECTED]) * * This program is free software; you can redistribute it and/or modify @@ -23,10 +23,10 @@ #include linux/module.h #include linux/init.h #include linux/errno.h #include linux/device.h +#include net/iucv/iucv.h #include asm/cpcmd.h #include asm/ebcdic.h - -#include iucv.h +#include smsgiucv.h struct smsg_callback { struct list_head list; @@ -39,38 +39,46 @@ MODULE_AUTHOR ((C) 2003 IBM Corporation by Martin Schwidefsky ([EMAIL PROTECTED])); MODULE_DESCRIPTION (Linux for S/390 IUCV special message driver); -static iucv_handle_t smsg_handle; -static unsigned short smsg_pathid; +static struct iucv_path *smsg_path; + static DEFINE_SPINLOCK(smsg_list_lock); static struct list_head smsg_list = LIST_HEAD_INIT(smsg_list); -static void -smsg_connection_complete(iucv_ConnectionComplete *eib, void *pgm_data) +static int smsg_path_pending(struct iucv_path *, u8 ipvmid[8], u8 ipuser[16]); +static void smsg_message_pending(struct iucv_path *, struct iucv_message *); + +static struct iucv_handler smsg_handler = { + .path_pending= smsg_path_pending, + .message_pending = smsg_message_pending, +}; + +static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], +u8 ipuser[16]) { + if (strncmp(ipvmid, *MSG, sizeof(ipvmid)) != 0) + return -EINVAL; + /* Path pending from *MSG. */ + return iucv_path_accept(path, smsg_handler, SMSGIUCV, NULL); } - -static void -smsg_message_pending(iucv_MessagePending *eib, void *pgm_data) +static void smsg_message_pending(struct iucv_path *path, +struct iucv_message *msg) { struct smsg_callback *cb; - unsigned char *msg; + unsigned char *buffer; unsigned char sender[9]; - unsigned short len; int rc, i; - len = eib-ln1msg2.ipbfln1f; - msg = kmalloc(len + 1, GFP_ATOMIC|GFP_DMA); - if (!msg) { - iucv_reject(eib-ippathid, eib-ipmsgid, eib-iptrgcls); + buffer = kmalloc(msg-length + 1, GFP_ATOMIC | GFP_DMA); + if (!buffer) { + iucv_message_reject(path, msg); return; } - rc = iucv_receive(eib-ippathid, eib-ipmsgid, eib-iptrgcls, - msg, len, NULL, NULL, NULL); + rc = iucv_message_receive(path, msg, 0, buffer, msg-length, NULL); if (rc == 0) { - msg[len] = 0; - EBCASC(msg, len); - memcpy(sender, msg, 8); + buffer[msg-length] = 0; + EBCASC(buffer, msg-length); + memcpy(sender, buffer, 8); sender[8] = 0; /* Remove trailing whitespace from the sender name. */ for (i = 7; i = 0; i--) { @@ -80,27 +88,17 @@ smsg_message_pending(iucv_MessagePending } spin_lock(smsg_list_lock); list_for_each_entry(cb, smsg_list, list) - if (strncmp(msg + 8, cb-prefix, cb-len) == 0) { - cb-callback(sender, msg + 8); + if (strncmp(buffer + 8, cb-prefix, cb-len) == 0) { + cb-callback(sender, buffer + 8); break; } spin_unlock(smsg_list_lock); } - kfree(msg); + kfree(buffer); } -static iucv_interrupt_ops_t smsg_ops = { - .ConnectionComplete = smsg_connection_complete, - .MessagePending = smsg_message_pending, -}; - -static struct device_driver smsg_driver = { - .name = SMSGIUCV, - .bus = iucv_bus, -}; - -int -smsg_register_callback(char *prefix, void (*callback)(char *from, char *str)) +int smsg_register_callback(char *prefix, + void (*callback)(char *from, char *str)) { struct smsg_callback *cb; @@ -110,18 +108,18 @@ smsg_register_callback(char *prefix, voi cb-prefix = prefix; cb-len = strlen(prefix); cb-callback = callback; - spin_lock(smsg_list_lock); + spin_lock_bh(smsg_list_lock); list_add_tail(cb-list, smsg_list); - spin_unlock(smsg_list_lock); + spin_unlock_bh(smsg_list_lock
[PATCH 3/7] [S390]: Adapt monreader driver to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt monreader character device driver to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/char/monreader.c | 218 +++-- 1 files changed, 101 insertions(+), 117 deletions(-) diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index a138b15..3a1a958 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -3,7 +3,7 @@ * * Character device driver for reading z/VM *MONITOR service records. * - * Copyright (C) 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH. + * Copyright 2004 IBM Corporation, IBM Deutschland Entwicklung GmbH. * * Author: Gerald Schaefer [EMAIL PROTECTED] */ @@ -22,7 +22,7 @@ #include asm/uaccess.h #include asm/ebcdic.h #include asm/extmem.h #include linux/poll.h -#include ../net/iucv.h +#include net/iucv/iucv.h //#define MON_DEBUG/* Debug messages on/off */ @@ -50,14 +50,13 @@ static char mon_dcss_name[9] = MONDCSS\ struct mon_msg { u32 pos; u32 mca_offset; - iucv_MessagePending local_eib; + struct iucv_message msg; char msglim_reached; char replied_msglim; }; struct mon_private { - u16 pathid; - iucv_handle_t iucv_handle; + struct iucv_path *path; struct mon_msg *msg_array[MON_MSGLIM]; unsigned int write_index; unsigned int read_index; @@ -75,8 +74,6 @@ static unsigned long mon_dcss_end; static DECLARE_WAIT_QUEUE_HEAD(mon_read_wait_queue); static DECLARE_WAIT_QUEUE_HEAD(mon_conn_wait_queue); -static u8 iucv_host[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - static u8 user_data_connect[16] = { /* Version code, must be 0x01 for shared mode */ 0x01, @@ -100,8 +97,7 @@ static u8 user_data_sever[16] = { * Create the 8 bytes EBCDIC DCSS segment name from * an ASCII name, incl. padding */ -static inline void -dcss_mkname(char *ascii_name, char *ebcdic_name) +static inline void dcss_mkname(char *ascii_name, char *ebcdic_name) { int i; @@ -119,8 +115,7 @@ dcss_mkname(char *ascii_name, char *ebcd * print appropriate error message for segment_load()/segment_type() * return code */ -static void -mon_segment_warn(int rc, char* seg_name) +static void mon_segment_warn(int rc, char* seg_name) { switch (rc) { case -ENOENT: @@ -166,44 +161,37 @@ mon_segment_warn(int rc, char* seg_name) } } -static inline unsigned long -mon_mca_start(struct mon_msg *monmsg) +static inline unsigned long mon_mca_start(struct mon_msg *monmsg) { - return monmsg-local_eib.ln1msg1.iprmmsg1_u32; + return *(u32 *) monmsg-msg.rmmsg; } -static inline unsigned long -mon_mca_end(struct mon_msg *monmsg) +static inline unsigned long mon_mca_end(struct mon_msg *monmsg) { - return monmsg-local_eib.ln1msg2.ipbfln1f; + return *(u32 *) monmsg-msg.rmmsg[4]; } -static inline u8 -mon_mca_type(struct mon_msg *monmsg, u8 index) +static inline u8 mon_mca_type(struct mon_msg *monmsg, u8 index) { return *((u8 *) mon_mca_start(monmsg) + monmsg-mca_offset + index); } -static inline u32 -mon_mca_size(struct mon_msg *monmsg) +static inline u32 mon_mca_size(struct mon_msg *monmsg) { return mon_mca_end(monmsg) - mon_mca_start(monmsg) + 1; } -static inline u32 -mon_rec_start(struct mon_msg *monmsg) +static inline u32 mon_rec_start(struct mon_msg *monmsg) { return *((u32 *) (mon_mca_start(monmsg) + monmsg-mca_offset + 4)); } -static inline u32 -mon_rec_end(struct mon_msg *monmsg) +static inline u32 mon_rec_end(struct mon_msg *monmsg) { return *((u32 *) (mon_mca_start(monmsg) + monmsg-mca_offset + 8)); } -static inline int -mon_check_mca(struct mon_msg *monmsg) +static inline int mon_check_mca(struct mon_msg *monmsg) { if ((mon_rec_end(monmsg) = mon_rec_start(monmsg)) || (mon_rec_start(monmsg) mon_dcss_start) || @@ -221,20 +209,17 @@ mon_check_mca(struct mon_msg *monmsg) return 0; } -static inline int -mon_send_reply(struct mon_msg *monmsg, struct mon_private *monpriv) +static inline int mon_send_reply(struct mon_msg *monmsg, +struct mon_private *monpriv) { - u8 prmmsg[8]; int rc; P_DEBUG(read, REPLY: pathid = 0x%04X, msgid = 0x%08X, trgcls = 0x%08X\n\n, - monmsg-local_eib.ippathid, monmsg-local_eib.ipmsgid, - monmsg-local_eib.iptrgcls); - rc = iucv_reply_prmmsg(monmsg-local_eib.ippathid, - monmsg-local_eib.ipmsgid, - monmsg-local_eib.iptrgcls, - 0, prmmsg); + monpriv-path-pathid, monmsg-msg.id, monmsg-msg.class); + + rc = iucv_message_reply(monpriv-path, monmsg-msg
[PATCH 4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
From: Martin Schwidefsky [EMAIL PROTECTED] Adapt vmlogrdr character device driver to new IUCV API Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/char/vmlogrdr.c | 284 +++--- 1 files changed, 129 insertions(+), 155 deletions(-) diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 6cb2304..8432a76 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -3,7 +3,7 @@ * character device driver for reading z/VM system service records * * - * Copyright (C) 2004 IBM Corporation + * Copyright 2004 IBM Corporation * character device driver for reading z/VM system service records, * Version 1.0 * Author(s): Xenia Tkatschow [EMAIL PROTECTED] @@ -21,7 +21,7 @@ #include asm/uaccess.h #include asm/cpcmd.h #include asm/debug.h #include asm/ebcdic.h -#include ../net/iucv.h +#include net/iucv/iucv.h #include linux/kmod.h #include linux/cdev.h #include linux/device.h @@ -60,12 +60,11 @@ struct vmlogrdr_priv_t { char system_service[8]; char internal_name[8]; char recording_name[8]; - u16 pathid; + struct iucv_path *path; int connection_established; int iucv_path_severed; - iucv_MessagePending local_interrupt_buffer; + struct iucv_message local_interrupt_buffer; atomic_t receive_ready; - iucv_handle_t iucv_handle; int minor_num; char * buffer; char * current_position; @@ -97,40 +96,21 @@ static struct file_operations vmlogrdr_f }; -static u8 iucvMagic[16] = { - 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0xF0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 -}; +static void vmlogrdr_iucv_path_complete(struct iucv_path *, u8 ipuser[16]); +static void vmlogrdr_iucv_path_severed(struct iucv_path *, u8 ipuser[16]); +static void vmlogrdr_iucv_message_pending(struct iucv_path *, + struct iucv_message *); -static u8 mask[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +static struct iucv_handler vmlogrdr_iucv_handler = { + .path_complete = vmlogrdr_iucv_path_complete, + .path_severed= vmlogrdr_iucv_path_severed, + .message_pending = vmlogrdr_iucv_message_pending, }; -static u8 iucv_host[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - -static void -vmlogrdr_iucv_ConnectionComplete(iucv_ConnectionComplete *eib, void *pgm_data); -static void -vmlogrdr_iucv_ConnectionSevered(iucv_ConnectionSevered *eib, void *pgm_data); -static void -vmlogrdr_iucv_MessagePending(iucv_MessagePending *eib, void *pgm_data); - - -static iucv_interrupt_ops_t vmlogrdr_iucvops = { - .ConnectionComplete = vmlogrdr_iucv_ConnectionComplete, - .ConnectionSevered = vmlogrdr_iucv_ConnectionSevered, - .MessagePending = vmlogrdr_iucv_MessagePending, -}; - - -DECLARE_WAIT_QUEUE_HEAD(conn_wait_queue); -DECLARE_WAIT_QUEUE_HEAD(read_wait_queue); +static DECLARE_WAIT_QUEUE_HEAD(conn_wait_queue); +static DECLARE_WAIT_QUEUE_HEAD(read_wait_queue); /* * pointer to system service private structure @@ -177,28 +157,29 @@ static struct cdev *vmlogrdr_cdev = NUL static int recording_class_AB; -static void -vmlogrdr_iucv_ConnectionComplete (iucv_ConnectionComplete * eib, - void * pgm_data) +static void vmlogrdr_iucv_path_complete(struct iucv_path *path, u8 ipuser[16]) { - struct vmlogrdr_priv_t * logptr = pgm_data; + struct vmlogrdr_priv_t * logptr = path-private; + spin_lock(logptr-priv_lock); logptr-connection_established = 1; spin_unlock(logptr-priv_lock); wake_up(conn_wait_queue); - return; } -static void -vmlogrdr_iucv_ConnectionSevered (iucv_ConnectionSevered * eib, void * pgm_data) +static void vmlogrdr_iucv_path_severed(struct iucv_path *path, u8 ipuser[16]) { - u8 reason = (u8) eib-ipuser[8]; - struct vmlogrdr_priv_t * logptr = pgm_data; + struct vmlogrdr_priv_t * logptr = path-private; + u8 reason = (u8) ipuser[8]; printk (KERN_ERR vmlogrdr: connection severed with reason %i\n, reason); + iucv_path_sever(path, NULL); + kfree(path); + logptr-path = NULL; + spin_lock(logptr-priv_lock); logptr-connection_established = 0; logptr-iucv_path_severed = 1; @@ -210,10 +191,10 @@ vmlogrdr_iucv_ConnectionSevered (iucv_Co } -static void -vmlogrdr_iucv_MessagePending (iucv_MessagePending * eib, void * pgm_data) +static void vmlogrdr_iucv_message_pending(struct iucv_path *path, + struct iucv_message *msg) { - struct vmlogrdr_priv_t * logptr
[PATCH 7/7] [S390]: Add AF_IUCV socket support
From: Jennifer Hunt[EMAIL PROTECTED] This patch adds AF_IUCV socket support. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/defconfig|1 include/linux/net.h|2 include/linux/socket.h |4 include/net/iucv/af_iucv.h | 106 net/iucv/Kconfig |8 net/iucv/Makefile |1 net/iucv/af_iucv.c | 1077 7 files changed, 1197 insertions(+), 2 deletions(-) diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 56fe005..11a8049 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig @@ -178,6 +178,7 @@ # CONFIG_XFRM_USER is not set # CONFIG_XFRM_SUB_POLICY is not set CONFIG_NET_KEY=y CONFIG_IUCV=m +CONFIG_AFIUCV=m CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set diff --git a/include/linux/net.h b/include/linux/net.h index f28d8a2..4db21e6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -24,7 +24,7 @@ #include asm/socket.h struct poll_table_struct; struct inode; -#define NPROTO 32 /* should be enough for now.. */ +#define NPROTO 33 /* should be enough for now.. */ #define SYS_SOCKET 1 /* sys_socket(2)*/ #define SYS_BIND 2 /* sys_bind(2) */ diff --git a/include/linux/socket.h b/include/linux/socket.h index 92cd38e..fcd35a2 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -187,7 +187,8 @@ #define AF_WANPIPE 25 /* Wanpipe API Soc #define AF_LLC 26 /* Linux LLC*/ #define AF_TIPC30 /* TIPC sockets */ #define AF_BLUETOOTH 31 /* Bluetooth sockets*/ -#define AF_MAX 32 /* For now.. */ +#define AF_IUCV32 /* IUCV sockets */ +#define AF_MAX 33 /* For now.. */ /* Protocol families, same as address families. */ #define PF_UNSPEC AF_UNSPEC @@ -220,6 +221,7 @@ #define PF_WANPIPE AF_WANPIPE #define PF_LLC AF_LLC #define PF_TIPCAF_TIPC #define PF_BLUETOOTH AF_BLUETOOTH +#define PF_IUCVAF_IUCV #define PF_MAX AF_MAX /* Maximum queue length specifiable by listen. */ diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h new file mode 100644 index 000..04d1abb --- /dev/null +++ b/include/net/iucv/af_iucv.h @@ -0,0 +1,106 @@ +/* + * Copyright 2006 IBM Corporation + * IUCV protocol stack for Linux on zSeries + * Version 1.0 + * Author(s): Jennifer Hunt [EMAIL PROTECTED] + * + */ + +#ifndef __AFIUCV_H +#define __AFIUCV_H + +#include asm/types.h +#include asm/byteorder.h +#include linux/list.h +#include linux/poll.h +#include linux/socket.h + +#ifndef AF_IUCV +#define AF_IUCV32 +#define PF_IUCVAF_IUCV +#endif + +/* Connection and socket states */ +enum { + IUCV_CONNECTED = 1, + IUCV_OPEN, + IUCV_BOUND, + IUCV_LISTEN, + IUCV_SEVERED, + IUCV_DISCONN, + IUCV_CLOSED +}; + +#define IUCV_QUEUELEN_DEFAULT 65535 +#define IUCV_CONN_TIMEOUT (HZ * 40) +#define IUCV_DISCONN_TIMEOUT (HZ * 2) +#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) +#define IUCV_BUFSIZE_DEFAULT 32768 + +/* IUCV socket address */ +struct sockaddr_iucv { + sa_family_t siucv_family; + unsigned short siucv_port; /* Reserved */ + unsigned intsiucv_addr; /* Reserved */ + charsiucv_nodeid[8];/* Reserved */ + charsiucv_user_id[8]; /* Guest User Id */ + charsiucv_name[8]; /* Application Name */ +}; + + +/* Common socket structures and functions */ + +#define iucv_sk(__sk) ((struct iucv_sock *) __sk) + +struct iucv_sock { + struct sock sk; + charsrc_user_id[8]; + charsrc_name[8]; + chardst_user_id[8]; + chardst_name[8]; + struct list_headaccept_q; + struct sock *parent; + struct iucv_path*path; + struct sk_buff_head send_skb_q; + unsigned intsend_tag; +}; + +struct iucv_sock_list { + struct hlist_head head; + rwlock_t lock; + atomic_t autobind_name; +}; + +static void iucv_sock_destruct(struct sock *sk); +static void iucv_sock_cleanup_listen(struct sock *parent); +static void iucv_sock_kill(struct sock *sk); +static void iucv_sock_close(struct sock *sk); +static int iucv_sock_create(struct socket *sock, int proto); +static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr, + int addr_len); +static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr, + int alen, int
Re: [PATCH 1/5] s390: qeth driver fixes
Sorry for the trouble and also thank you very much for having done the extra work. I made the patches using git-format-patch so seems that I have to review them more carefully or I still haven't understand to use git-format-patch properly. In any case I will read the documents you mentioned once again to keep such points in mind... Frank On Tue, Jan 09, 2007 at 02:23:23AM -0500, Jeff Garzik wrote: Frank Pavlic wrote: Hi , please apply following 5 patches for s390 network device drivers. Sorry for the fifth patch containing some lines which just remove whitespaces. Another patch will follow in the next couple of days with more whitespace and coding style cleanups in drivers/s390/net. Thank you Frank [PATCH 1/5] s390: qeth driver fixes From: Frank Blaschka [EMAIL PROTECTED] From: Ursula Braun [EMAIL PROTECTED] - VLAN header reordering did not work on packets received through qeth interface in layer 2 mode. This caused dhcpcd not to work with VLAN devices. - set qeth performance statistics initally inactive Signed-off-by: Frank Pavlic [EMAIL PROTECTED] applied patches 1-4 of 5. patch #5 failed to apply, and also, it's not really appropriate for the current release candidate bugfix window. Also: 1) Please include notes to me and reviewers following the --- marker. Everything before the --- is copied /verbatim/ into the kernel changelog. Everything after ---, except the patch itself, is ignored. I had to hand-edit each of your patches, to remove the Hi , ... Frank paragraph and the [PATCH 1/5] S390: ... from the body of each email. 2) Your subject line should be more descriptive. The subject line is used to generate a one-line summary. You can see how your subject lines are vague: [PATCH] s390: qeth driver fixes [PATCH] s390: qeth driver fixes [PATCH] s390: qeth driver fixes Here, I had to hand-edit each email subject line to be more descriptive. 3) In general, review Documentation/SubmittingPatches and http://linux.yyz.us/patch-format.html Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] s390: qeth driver fixes
[PATCH 3/5] s390: qeth driver fixes From: Frank Blaschka [EMAIL PROTECTED] - qeth device functions were not callable in atomic context due to usage of wait_event_xxx operations in qeth. schedule while atomic message appeared and kernel dumped when removing slave from bond device. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth.h |2 - drivers/s390/net/qeth_main.c | 125 ++ 2 files changed, 30 insertions(+), 97 deletions(-) diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 53c358c..e95c281 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -710,7 +710,7 @@ struct qeth_reply { int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long); u32 seqno; unsigned long offset; - int received; + atomic_t received; int rc; void *param; struct qeth_card *card; diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 337304d..19ec4c8 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -471,7 +471,7 @@ qeth_irq(struct ccw_device *cdev, unsign channel-state == CH_STATE_UP) qeth_issue_next_read(card); - tasklet_schedule(channel-irq_tasklet); + qeth_irq_tasklet((unsigned long)channel); return; out: wake_up(card-wait_q); @@ -951,40 +951,6 @@ qeth_do_run_thread(struct qeth_card *car } static int -qeth_register_ip_addresses(void *ptr) -{ - struct qeth_card *card; - - card = (struct qeth_card *) ptr; - daemonize(qeth_reg_ip); - QETH_DBF_TEXT(trace,4,regipth1); - if (!qeth_do_run_thread(card, QETH_SET_IP_THREAD)) - return 0; - QETH_DBF_TEXT(trace,4,regipth2); - qeth_set_ip_addr_list(card); - qeth_clear_thread_running_bit(card, QETH_SET_IP_THREAD); - return 0; -} - -/* - * Drive the SET_PROMISC_MODE thread - */ -static int -qeth_set_promisc_mode(void *ptr) -{ - struct qeth_card *card = (struct qeth_card *) ptr; - - daemonize(qeth_setprm); - QETH_DBF_TEXT(trace,4,setprm1); - if (!qeth_do_run_thread(card, QETH_SET_PROMISC_MODE_THREAD)) - return 0; - QETH_DBF_TEXT(trace,4,setprm2); - qeth_setadp_promisc_mode(card); - qeth_clear_thread_running_bit(card, QETH_SET_PROMISC_MODE_THREAD); - return 0; -} - -static int qeth_recover(void *ptr) { struct qeth_card *card; @@ -1047,11 +1013,6 @@ qeth_start_kernel_thread(struct work_str if (card-read.state != CH_STATE_UP card-write.state != CH_STATE_UP) return; - - if (qeth_do_start_thread(card, QETH_SET_IP_THREAD)) - kernel_thread(qeth_register_ip_addresses, (void *)card,SIGCHLD); - if (qeth_do_start_thread(card, QETH_SET_PROMISC_MODE_THREAD)) - kernel_thread(qeth_set_promisc_mode, (void *)card, SIGCHLD); if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) kernel_thread(qeth_recover, (void *) card, SIGCHLD); } @@ -1613,8 +1574,6 @@ qeth_issue_next_read(struct qeth_card *c return -ENOMEM; } qeth_setup_ccw(card-read, iob-data, QETH_BUFSIZE); - wait_event(card-wait_q, - atomic_cmpxchg(card-read.irq_pending, 0, 1) == 0); QETH_DBF_TEXT(trace, 6, noirqpnd); rc = ccw_device_start(card-read.ccwdev, card-read.ccw, (addr_t) iob, 0, 0); @@ -1635,6 +1594,7 @@ qeth_alloc_reply(struct qeth_card *card) reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC); if (reply){ atomic_set(reply-refcnt, 1); + atomic_set(reply-received, 0); reply-card = card; }; return reply; @@ -1655,31 +1615,6 @@ qeth_put_reply(struct qeth_reply *reply) kfree(reply); } -static void -qeth_cmd_timeout(unsigned long data) -{ - struct qeth_reply *reply, *list_reply, *r; - unsigned long flags; - - reply = (struct qeth_reply *) data; - spin_lock_irqsave(reply-card-lock, flags); - list_for_each_entry_safe(list_reply, r, -reply-card-cmd_waiter_list, list) { - if (reply == list_reply){ - qeth_get_reply(reply); - list_del_init(reply-list); - spin_unlock_irqrestore(reply-card-lock, flags); - reply-rc = -ETIME; - reply-received = 1; - wake_up(reply-wait_q); - qeth_put_reply(reply); - return; - } - } - spin_unlock_irqrestore(reply-card-lock, flags); -} - - static struct qeth_ipa_cmd * qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) { @@ -1745,7 +1680,7 @@ qeth_clear_ipacmd_list(struct qeth_card
[PATCH 2/5] s390: qeth driver fixes
[PATCH 2/5] s390: qeth driver fixes From: Frank Blaschka [EMAIL PROTECTED] - packet socket support is not complete. Recvfrom a packet socket does not fill the sockaddr_ll structure. device function hard_header_parse is not implemented. For layer 2 mode and layer 3 mode with fake_ll turned on, we have the information to fill sockaddr_ll. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 58 ++ 1 files changed, 53 insertions(+), 5 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 67062d5..337304d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3953,13 +3953,22 @@ static inline struct sk_buff * qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr **hdr, int ipv) { - struct sk_buff *new_skb; + struct sk_buff *new_skb, *new_skb2; QETH_DBF_TEXT(trace, 6, prepskb); - -new_skb = qeth_realloc_headroom(card, skb, sizeof(struct qeth_hdr)); - if (new_skb == NULL) + new_skb = skb; + new_skb = qeth_pskb_unshare(skb, GFP_ATOMIC); + if (!new_skb) return NULL; + new_skb2 = qeth_realloc_headroom(card, new_skb, +sizeof(struct qeth_hdr)); + if (!new_skb2) { + __qeth_free_new_skb(skb, new_skb); + return NULL; + } + if (new_skb != skb) + __qeth_free_new_skb(new_skb2, new_skb); + new_skb = new_skb2; *hdr = __qeth_prepare_skb(card, new_skb, ipv); if (*hdr == NULL) { __qeth_free_new_skb(skb, new_skb); @@ -6336,6 +6345,42 @@ static struct ethtool_ops qeth_ethtool_o }; static int +qeth_hard_header_parse(struct sk_buff *skb, unsigned char *haddr) +{ + struct qeth_card *card; + struct ethhdr *eth; + + card = qeth_get_card_from_dev(skb-dev); + if (card-options.layer2) + goto haveheader; +#ifdef CONFIG_QETH_IPV6 + /* cause of the manipulated arp constructor and the ARP + flag for OSAE devices we have some nasty exceptions */ + if (card-info.type == QETH_CARD_TYPE_OSAE) { + if (!card-options.fake_ll) { + if ((skb-pkt_type==PACKET_OUTGOING) + (skb-protocol==ETH_P_IPV6)) + goto haveheader; + else + return 0; + } else { + if ((skb-pkt_type==PACKET_OUTGOING) + (skb-protocol==ETH_P_IP)) + return 0; + else + goto haveheader; + } + } +#endif + if (!card-options.fake_ll) + return 0; +haveheader: + eth = eth_hdr(skb); + memcpy(haddr, eth-h_source, ETH_ALEN); + return ETH_ALEN; +} + +static int qeth_netdev_init(struct net_device *dev) { struct qeth_card *card; @@ -6373,7 +6418,10 @@ #endif if (card-options.fake_ll (qeth_get_netdev_flags(card) IFF_NOARP)) dev-hard_header = qeth_fake_header; - dev-hard_header_parse = NULL; + if (dev-type == ARPHRD_IEEE802_TR) + dev-hard_header_parse = NULL; + else + dev-hard_header_parse = qeth_hard_header_parse; dev-set_mac_address = qeth_layer2_set_mac_address; dev-flags |= qeth_get_netdev_flags(card); if ((card-options.fake_broadcast) || -- 1.4.2.3 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/5] s390: iucv Kconfig help description changes
[PATCH 4/5] s390: iucv Kconfig help description changes From: Ursula Braun [EMAIL PROTECTED] remove text from help description which does not apply anymore for 2.6 kernel series. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/Kconfig |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/s390/net/Kconfig b/drivers/s390/net/Kconfig index 1a93fa6..5262515 100644 --- a/drivers/s390/net/Kconfig +++ b/drivers/s390/net/Kconfig @@ -27,10 +27,7 @@ config IUCV help Select this option if you want to use inter-user communication under VM or VIF. If unsure, say Y to enable a fast communication - link between VM guests. At boot time the user ID of the guest needs - to be passed to the kernel. Note that both kernels need to be - compiled with this option and both need to be booted with the user ID - of the other VM guest. + link between VM guests. config NETIUCV tristate IUCV network device support (VM only) -- 1.4.2.3 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/5] s390: qeth driver fixes
Hi , please apply following 5 patches for s390 network device drivers. Sorry for the fifth patch containing some lines which just remove whitespaces. Another patch will follow in the next couple of days with more whitespace and coding style cleanups in drivers/s390/net. Thank you Frank [PATCH 1/5] s390: qeth driver fixes From: Frank Blaschka [EMAIL PROTECTED] From: Ursula Braun [EMAIL PROTECTED] - VLAN header reordering did not work on packets received through qeth interface in layer 2 mode. This caused dhcpcd not to work with VLAN devices. - set qeth performance statistics initally inactive Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 21 +++-- 1 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 2bde4f1..67062d5 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1074,7 +1074,7 @@ #endif /* QETH_IPV6 */ card-options.layer2 = 1; else card-options.layer2 = 0; - card-options.performance_stats = 1; + card-options.performance_stats = 0; } /** @@ -2466,32 +2466,17 @@ qeth_rebuild_skb_fake_ll(struct qeth_car qeth_rebuild_skb_fake_ll_eth(card, skb, hdr); } -static inline __u16 +static inline void qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr *hdr) { - unsigned short vlan_id = 0; -#ifdef CONFIG_QETH_VLAN - struct vlan_hdr *vhdr; -#endif - skb-pkt_type = PACKET_HOST; skb-protocol = qeth_type_trans(skb, skb-dev); if (card-options.checksum_type == NO_CHECKSUMMING) skb-ip_summed = CHECKSUM_UNNECESSARY; else skb-ip_summed = CHECKSUM_NONE; -#ifdef CONFIG_QETH_VLAN - if (hdr-hdr.l2.flags[2] (QETH_LAYER2_FLAG_VLAN)) { - vhdr = (struct vlan_hdr *) skb-data; - skb-protocol = - __constant_htons(vhdr-h_vlan_encapsulated_proto); - vlan_id = hdr-hdr.l2.vlan_id; - skb_pull(skb, VLAN_HLEN); - } -#endif *((__u32 *)skb-cb) = ++card-seqno.pkt_seqno; - return vlan_id; } static inline __u16 @@ -2571,7 +2556,7 @@ qeth_process_inbound_buffer(struct qeth_ offset, hdr))) { skb-dev = card-dev; if (hdr-hdr.l2.id == QETH_HEADER_TYPE_LAYER2) - vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); + qeth_layer2_rebuild_skb(card, skb, hdr); else if (hdr-hdr.l3.id == QETH_HEADER_TYPE_LAYER3) vlan_tag = qeth_rebuild_skb(card, skb, hdr); else { /*in case of OSN*/ -- 1.4.2.3 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/5] s390: qeth driver hardware specs adaptions
[PATCH 5/5] s390: qeth driver hardware specs adaptions From: Peter Tiedemann [EMAIL PROTECTED] - according to the latest OSA hardware specification incorporate actual IPA command and return codes into qeth. - whitespaces removed from qeth_mpc.h Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 10 ++ drivers/s390/net/qeth_mpc.c | 101 +++ drivers/s390/net/qeth_mpc.h | 220 -- 3 files changed, 238 insertions(+), 93 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 19ec4c8..be4f815 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1919,6 +1919,9 @@ qeth_send_ipa_cmd(struct qeth_card *card { int rc; char prot_type; + int cmd; + cmd = ((struct qeth_ipa_cmd *) + (iob-data+IPA_PDU_HEADER_SIZE))-hdr.command; QETH_DBF_TEXT(trace,4,sendipa); @@ -1932,6 +1935,12 @@ qeth_send_ipa_cmd(struct qeth_card *card qeth_prepare_ipa_cmd(card,iob,prot_type); rc = qeth_send_control_data(card, IPA_CMD_LENGTH, iob, reply_cb, reply_param); + if (rc != 0) { + char * ipa_cmd_name; + ipa_cmd_name = qeth_get_ipa_cmd_name(cmd); + printk(%s %s(%x) returned %s(%x)\n,__FUNCTION__, + ipa_cmd_name, cmd, qeth_get_ipa_msg(rc), rc); + } return rc; } @@ -2486,7 +2495,6 @@ qeth_process_inbound_buffer(struct qeth_ int offset; int rxrc; __u16 vlan_tag = 0; - __u16 *vlan_addr; /* get first element of current buffer */ element = (struct qdio_buffer_element *)buf-buffer-element[0]; diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c index 77c8320..f54fdfd 100644 --- a/drivers/s390/net/qeth_mpc.c +++ b/drivers/s390/net/qeth_mpc.c @@ -157,12 +157,113 @@ unsigned char READ_CCW[]={ }; +struct ipa_rc_msg { + enum qeth_ipa_return_codes rc; + char *msg; +}; +struct ipa_rc_msg qeth_ipa_rc_msg[] = { + {IPA_RC_SUCCESS,success}, + {IPA_RC_NOTSUPP,Command not supported}, + {IPA_RC_IP_TABLE_FULL, Add Addr IP Table Full - ipv6}, + {IPA_RC_UNKNOWN_ERROR, IPA command failed - reason unknown}, + {IPA_RC_UNSUPPORTED_COMMAND,Command not supported}, + {IPA_RC_DUP_IPV6_REMOTE,ipv6 address already registered remote}, + {IPA_RC_DUP_IPV6_HOME, ipv6 address already registered}, + {IPA_RC_UNREGISTERED_ADDR, Address not registered}, + {IPA_RC_NO_ID_AVAILABLE,No identifiers available}, + {IPA_RC_ID_NOT_FOUND, Identifier not found}, + {IPA_RC_INVALID_IP_VERSION, IP version incorrect}, + {IPA_RC_LAN_FRAME_MISMATCH, LAN and frame mismatch}, + {IPA_RC_L2_UNSUPPORTED_CMD, Unsupported layer 2 command}, + {IPA_RC_L2_DUP_MAC, Duplicate MAC address}, + {IPA_RC_L2_ADDR_TABLE_FULL, Layer2 address table full}, + {IPA_RC_L2_DUP_LAYER3_MAC, Duplicate with layer 3 MAC}, + {IPA_RC_L2_GMAC_NOT_FOUND, GMAC not found}, + {IPA_RC_L2_MAC_NOT_FOUND, L2 mac address not found}, + {IPA_RC_L2_INVALID_VLAN_ID, L2 invalid vlan id}, + {IPA_RC_L2_DUP_VLAN_ID, L2 duplicate vlan id}, + {IPA_RC_L2_VLAN_ID_NOT_FOUND, L2 vlan id not found}, + {IPA_RC_DATA_MISMATCH, Data field mismatch (v4/v6 mixed)}, + {IPA_RC_INVALID_MTU_SIZE, Invalid MTU size}, + {IPA_RC_INVALID_LANTYPE,Invalid LAN type}, + {IPA_RC_INVALID_LANNUM, Invalid LAN num}, + {IPA_RC_DUPLICATE_IP_ADDRESS, Address already registered}, + {IPA_RC_IP_ADDR_TABLE_FULL, IP address table full}, + {IPA_RC_LAN_PORT_STATE_ERROR, LAN port state error}, + {IPA_RC_SETIP_NO_STARTLAN, Setip no startlan received}, + {IPA_RC_SETIP_ALREADY_RECEIVED, Setip already received}, + {IPA_RC_IP_ADDR_ALREADY_USED, IP address already in use on LAN}, + {IPA_RC_MULTICAST_FULL, No task available, multicast full}, + {IPA_RC_SETIP_INVALID_VERSION, SETIP invalid IP version}, + {IPA_RC_UNSUPPORTED_SUBCMD, Unsupported assist subcommand}, + {IPA_RC_ARP_ASSIST_NO_ENABLE, Only partial success, no enable}, + {IPA_RC_PRIMARY_ALREADY_DEFINED,Primary already defined}, + {IPA_RC_SECOND_ALREADY_DEFINED, Secondary already defined}, + {IPA_RC_INVALID_SETRTG_INDICATOR,Invalid SETRTG indicator}, + {IPA_RC_MC_ADDR_ALREADY_DEFINED,Multicast address already defined}, + {IPA_RC_LAN_OFFLINE,STRTLAN_LAN_DISABLED - LAN offline}, + {IPA_RC_INVALID_IP_VERSION2,Invalid IP version}, + {IPA_RC_, Unknown Error} +}; +char * +qeth_get_ipa_msg(enum qeth_ipa_return_codes
[PATCH 4/9] s390: qeth driver fixes [1/6]
[PATCH 4/9] s390: qeth driver fixes [1/6] From: Frank Pavlic [EMAIL PROTECTED] - Drop incoming packets with vlan_tag set if card-vlangrp is not set. - use always vlan_hwaccel_rx to pass vlan frames to the stack. - fix recovery problem. Device was recovered properly but still not working. netif_carrier_on call right before recovery start fixes it. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 49 -- 1 files changed, 23 insertions(+), 26 deletions(-) aa7f6f1f5639e15a5bff562fbc19cbbd701c0078 diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index e1327b8..7a1 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1708,6 +1708,7 @@ qeth_check_ipa_data(struct qeth_card *ca IP address reset.\n, QETH_CARD_IFNAME(card), card-info.chpid); + netif_carrier_on(card-dev); qeth_schedule_recovery(card); return NULL; case IPA_CMD_MODCCID: @@ -2464,24 +2465,6 @@ qeth_rebuild_skb_fake_ll(struct qeth_car qeth_rebuild_skb_fake_ll_eth(card, skb, hdr); } -static inline void -qeth_rebuild_skb_vlan(struct qeth_card *card, struct sk_buff *skb, - struct qeth_hdr *hdr) -{ -#ifdef CONFIG_QETH_VLAN - u16 *vlan_tag; - - if (hdr-hdr.l3.ext_flags - (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { - vlan_tag = (u16 *) skb_push(skb, VLAN_HLEN); - *vlan_tag = (hdr-hdr.l3.ext_flags QETH_HDR_EXT_VLAN_FRAME)? - hdr-hdr.l3.vlan_id : *((u16 *)hdr-hdr.l3.dest_addr[12]); - *(vlan_tag + 1) = skb-protocol; - skb-protocol = __constant_htons(ETH_P_8021Q); - } -#endif /* CONFIG_QETH_VLAN */ -} - static inline __u16 qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr *hdr) @@ -2510,15 +2493,16 @@ qeth_layer2_rebuild_skb(struct qeth_card return vlan_id; } -static inline void +static inline __u16 qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr *hdr) { + unsigned short vlan_id = 0; #ifdef CONFIG_QETH_IPV6 if (hdr-hdr.l3.flags QETH_HDR_PASSTHRU) { skb-pkt_type = PACKET_HOST; skb-protocol = qeth_type_trans(skb, card-dev); - return; + return 0; } #endif /* CONFIG_QETH_IPV6 */ skb-protocol = htons((hdr-hdr.l3.flags QETH_HDR_IPV6)? ETH_P_IPV6 : @@ -2540,7 +2524,13 @@ qeth_rebuild_skb(struct qeth_card *card, default: skb-pkt_type = PACKET_HOST; } - qeth_rebuild_skb_vlan(card, skb, hdr); + + if (hdr-hdr.l3.ext_flags + (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { + vlan_id = (hdr-hdr.l3.ext_flags QETH_HDR_EXT_VLAN_FRAME)? + hdr-hdr.l3.vlan_id : *((u16 *)hdr-hdr.l3.dest_addr[12]); + } + if (card-options.fake_ll) qeth_rebuild_skb_fake_ll(card, skb, hdr); else @@ -2556,6 +2546,7 @@ qeth_rebuild_skb(struct qeth_card *card, else skb-ip_summed = SW_CHECKSUMMING; } + return vlan_id; } static inline void @@ -2568,6 +2559,7 @@ qeth_process_inbound_buffer(struct qeth_ int offset; int rxrc; __u16 vlan_tag = 0; + __u16 *vlan_addr; /* get first element of current buffer */ element = (struct qdio_buffer_element *)buf-buffer-element[0]; @@ -2581,7 +2573,7 @@ qeth_process_inbound_buffer(struct qeth_ if (hdr-hdr.l2.id == QETH_HEADER_TYPE_LAYER2) vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); else if (hdr-hdr.l3.id == QETH_HEADER_TYPE_LAYER3) - qeth_rebuild_skb(card, skb, hdr); + vlan_tag = qeth_rebuild_skb(card, skb, hdr); else { /*in case of OSN*/ skb_push(skb, sizeof(struct qeth_hdr)); memcpy(skb-data, hdr, sizeof(struct qeth_hdr)); @@ -2591,14 +2583,19 @@ qeth_process_inbound_buffer(struct qeth_ dev_kfree_skb_any(skb); continue; } + if (card-info.type == QETH_CARD_TYPE_OSN) + rxrc = card-osn_info.data_cb(skb); + else #ifdef CONFIG_QETH_VLAN if (vlan_tag) - vlan_hwaccel_rx(skb, card-vlangrp, vlan_tag); + if (card-vlangrp) + vlan_hwaccel_rx(skb
[PATCH 8/9] s390: qeth driver fixes [5/6]
[PATCH 8/9] s390: qeth driver fixes [5/6] From: Frank Pavlic [EMAIL PROTECTED] fix kernel panic in qdio queue handling. qeth_qdio_clear_card() could be invoked by 2 CPUs simultaneously (for example reboot event and recovery). Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth.h |3 +- drivers/s390/net/qeth_main.c | 71 +- 2 files changed, 44 insertions(+), 30 deletions(-) 146a24d1aeba1ad3b16e98a5553693ccc0799349 diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 22a7ffb..821383d 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -463,6 +463,7 @@ enum qeth_qdio_info_states { QETH_QDIO_UNINITIALIZED, QETH_QDIO_ALLOCATED, QETH_QDIO_ESTABLISHED, + QETH_QDIO_CLEANING }; struct qeth_buffer_pool_entry { @@ -537,7 +538,7 @@ struct qeth_qdio_out_q { } __attribute__ ((aligned(256))); struct qeth_qdio_info { - volatile enum qeth_qdio_info_states state; + atomic_t state; /* input */ struct qeth_qdio_q *in_q; struct qeth_qdio_buffer_pool in_buf_pool; diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 0bc55a3..a1b2e6f 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3179,13 +3179,14 @@ qeth_alloc_qdio_buffers(struct qeth_card QETH_DBF_TEXT(setup, 2, allcqdbf); - if (card-qdio.state == QETH_QDIO_ALLOCATED) + if (atomic_cmpxchg(card-qdio.state, QETH_QDIO_UNINITIALIZED, + QETH_QDIO_ALLOCATED) != QETH_QDIO_UNINITIALIZED) return 0; card-qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), GFP_KERNEL|GFP_DMA); if (!card-qdio.in_q) - return - ENOMEM; + goto out_nomem; QETH_DBF_TEXT(setup, 2, inq); QETH_DBF_HEX(setup, 2, card-qdio.in_q, sizeof(void *)); memset(card-qdio.in_q, 0, sizeof(struct qeth_qdio_q)); @@ -3194,27 +3195,19 @@ qeth_alloc_qdio_buffers(struct qeth_card card-qdio.in_q-bufs[i].buffer = card-qdio.in_q-qdio_bufs[i]; /* inbound buffer pool */ - if (qeth_alloc_buffer_pool(card)){ - kfree(card-qdio.in_q); - return -ENOMEM; - } + if (qeth_alloc_buffer_pool(card)) + goto out_freeinq; /* outbound */ card-qdio.out_qs = kmalloc(card-qdio.no_out_queues * sizeof(struct qeth_qdio_out_q *), GFP_KERNEL); - if (!card-qdio.out_qs){ - qeth_free_buffer_pool(card); - return -ENOMEM; - } - for (i = 0; i card-qdio.no_out_queues; ++i){ + if (!card-qdio.out_qs) + goto out_freepool; + for (i = 0; i card-qdio.no_out_queues; ++i) { card-qdio.out_qs[i] = kmalloc(sizeof(struct qeth_qdio_out_q), GFP_KERNEL|GFP_DMA); - if (!card-qdio.out_qs[i]){ - while (i 0) - kfree(card-qdio.out_qs[--i]); - kfree(card-qdio.out_qs); - return -ENOMEM; - } + if (!card-qdio.out_qs[i]) + goto out_freeoutq; QETH_DBF_TEXT_(setup, 2, outq %i, i); QETH_DBF_HEX(setup, 2, card-qdio.out_qs[i], sizeof(void *)); memset(card-qdio.out_qs[i], 0, sizeof(struct qeth_qdio_out_q)); @@ -3231,8 +3224,19 @@ qeth_alloc_qdio_buffers(struct qeth_card INIT_LIST_HEAD(card-qdio.out_qs[i]-bufs[j].ctx_list); } } - card-qdio.state = QETH_QDIO_ALLOCATED; return 0; + +out_freeoutq: + while (i 0) + kfree(card-qdio.out_qs[--i]); + kfree(card-qdio.out_qs); +out_freepool: + qeth_free_buffer_pool(card); +out_freeinq: + kfree(card-qdio.in_q); +out_nomem: + atomic_set(card-qdio.state, QETH_QDIO_UNINITIALIZED); + return -ENOMEM; } static void @@ -3241,7 +3245,8 @@ qeth_free_qdio_buffers(struct qeth_card int i, j; QETH_DBF_TEXT(trace, 2, freeqdbf); - if (card-qdio.state == QETH_QDIO_UNINITIALIZED) + if (atomic_swap(card-qdio.state, QETH_QDIO_UNINITIALIZED) == + QETH_QDIO_UNINITIALIZED) return; kfree(card-qdio.in_q); /* inbound buffer pool */ @@ -3254,7 +3259,6 @@ qeth_free_qdio_buffers(struct qeth_card kfree(card-qdio.out_qs[i]); } kfree(card-qdio.out_qs); - card-qdio.state = QETH_QDIO_UNINITIALIZED; } static void @@ -3276,7 +3280,7 @@ static void qeth_init_qdio_info(struct qeth_card *card) { QETH_DBF_TEXT(setup, 4, intqdinf); - card-qdio.state = QETH_QDIO_UNINITIALIZED; + atomic_set(card-qdio.state, QETH_QDIO_UNINITIALIZED
[PATCH 5/9] s390: qeth driver fixes [2/6]
[PATCH 5/9] s390: qeth driver fixes [2/6] From: Frank Pavlic [EMAIL PROTECTED] - fixed error handling in create_device_attributes - fixed some minor bugs in IPv4 and IPv6 address checking Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth.h | 25 - drivers/s390/net/qeth_sys.c | 22 -- 2 files changed, 32 insertions(+), 15 deletions(-) 8d7b1277f7334cf8c5390d72563dcd22f69f3eb4 diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 619f4a0..e8bd8c5 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -1096,10 +1096,11 @@ qeth_string_to_ipaddr4(const char *buf, { int count = 0, rc = 0; int in[4]; + char c; - rc = sscanf(buf, %d.%d.%d.%d%n, - in[0], in[1], in[2], in[3], count); - if (rc != 4 || count=0) + rc = sscanf(buf, %u.%u.%u.%u%c, + in[0], in[1], in[2], in[3], c); + if (rc != 4 (rc != 5 || c != '\n')) return -EINVAL; for (count = 0; count 4; count++) { if (in[count] 255) @@ -1123,24 +1124,28 @@ qeth_ipaddr6_to_string(const __u8 *addr, static inline int qeth_string_to_ipaddr6(const char *buf, __u8 *addr) { - char *end, *start; + const char *end, *end_tmp, *start; __u16 *in; char num[5]; int num2, cnt, out, found, save_cnt; unsigned short in_tmp[8] = {0, }; cnt = out = found = save_cnt = num2 = 0; -end = start = (char *) buf; +end = start = buf; in = (__u16 *) addr; memset(in, 0, 16); -while (end) { -end = strchr(end,':'); +while (*end) { +end = strchr(start,':'); if (end == NULL) { -end = (char *)buf + (strlen(buf)); -out = 1; +end = buf + strlen(buf); + if ((end_tmp = strchr(start, '\n')) != NULL) + end = end_tmp; + out = 1; } if ((end - start)) { memset(num, 0, 5); + if ((end - start) 4) + return -EINVAL; memcpy(num, start, end - start); if (!qeth_isxdigit(num)) return -EINVAL; @@ -1158,6 +1163,8 @@ qeth_string_to_ipaddr6(const char *buf, } start = ++end; } + if (cnt + save_cnt 8) + return -EINVAL; cnt = 7; while (save_cnt) in[cnt--] = in_tmp[--save_cnt]; diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index 001497b..c1f3187 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -1110,12 +1110,12 @@ qeth_parse_ipatoe(const char* buf, enum { const char *start, *end; char *tmp; - char buffer[49] = {0, }; + char buffer[40] = {0, }; start = buf; /* get address string */ end = strchr(start, '/'); - if (!end || (end-start = 49)){ + if (!end || (end - start = 40)){ PRINT_WARN(Invalid format for ipato_addx/delx. Use ip addr/mask bits\n); return -EINVAL; @@ -1127,7 +1127,12 @@ qeth_parse_ipatoe(const char* buf, enum } start = end + 1; *mask_bits = simple_strtoul(start, tmp, 10); - + if (!strlen(start) || + (tmp == start) || + (*mask_bits ((proto == QETH_PROT_IPV4) ? 32 : 128))) { + PRINT_WARN(Invalid mask bits for ipato_addx/delx !\n); + return -EINVAL; + } return 0; } @@ -1698,11 +1703,16 @@ qeth_create_device_attributes(struct dev sysfs_remove_group(dev-kobj, qeth_device_attr_group); sysfs_remove_group(dev-kobj, qeth_device_ipato_group); sysfs_remove_group(dev-kobj, qeth_device_vipa_group); + return ret; } - if ((ret = sysfs_create_group(dev-kobj, qeth_device_blkt_group))) + if ((ret = sysfs_create_group(dev-kobj, qeth_device_blkt_group))){ + sysfs_remove_group(dev-kobj, qeth_device_attr_group); + sysfs_remove_group(dev-kobj, qeth_device_ipato_group); + sysfs_remove_group(dev-kobj, qeth_device_vipa_group); + sysfs_remove_group(dev-kobj, qeth_device_rxip_group); return ret; - - return ret; + } + return 0; } void -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RESEND PATCH 1/9] s390: minor s390 network driver fixes
Hi Jeff, this is a RESEND of the nine s390 network driver patches. I finally found that my kmail corrupted almost every patch I sent the last time. Please apply these 9 patches and forget about my first attempt! Sorry for the delay, I had some fights with sendmail, IMAP and mutt configuration. Frank [RESEND PATCH 1/9] s390: minor s390 network driver fixes From: Frank Pavlic [EMAIL PROTECTED] - iucv driver: use do { } while (0) constructs instead of empty defines to avoid compile bugs. - ctc driver: missing lock initialization added - lcs driver: BUG_ON usage was removed accidently with the last lcs patch. Put them back in place. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/ctcmain.c |3 +++ drivers/s390/net/iucv.c|4 ++-- drivers/s390/net/lcs.c | 13 + 3 files changed, 10 insertions(+), 10 deletions(-) d7012f9f15697e7dc7901108401bd8bcea1bd97d diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index 8a4b581..3257c22 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -1714,6 +1714,9 @@ add_channel(struct ccw_device *cdev, enu kfree(ch); return 0; } + + spin_lock_init(ch-collect_lock); + fsm_settimer(ch-fsm, ch-timer); skb_queue_head_init(ch-io_queue); skb_queue_head_init(ch-collect_queue); diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 0e863df..821dde8 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -335,8 +335,8 @@ do { \ #else -#define iucv_debug(lvl, fmt, args...) -#define iucv_dumpit(title, buf, len) +#define iucv_debug(lvl, fmt, args...) do { } while (0) +#define iucv_dumpit(title, buf, len) do { } while (0) #endif diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 2eded55..16ac68c 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -670,9 +670,8 @@ lcs_ready_buffer(struct lcs_channel *cha int index, rc; LCS_DBF_TEXT(5, trace, rdybuff); - if (buffer-state != BUF_STATE_LOCKED - buffer-state != BUF_STATE_PROCESSED) - BUG(); + BUG_ON(buffer-state != BUF_STATE_LOCKED + buffer-state != BUF_STATE_PROCESSED); spin_lock_irqsave(get_ccwdev_lock(channel-ccwdev), flags); buffer-state = BUF_STATE_READY; index = buffer - channel-iob; @@ -696,8 +695,7 @@ __lcs_processed_buffer(struct lcs_channe int index, prev, next; LCS_DBF_TEXT(5, trace, prcsbuff); - if (buffer-state != BUF_STATE_READY) - BUG(); + BUG_ON(buffer-state != BUF_STATE_READY); buffer-state = BUF_STATE_PROCESSED; index = buffer - channel-iob; prev = (index - 1) (LCS_NUM_BUFFS - 1); @@ -729,9 +727,8 @@ lcs_release_buffer(struct lcs_channel *c unsigned long flags; LCS_DBF_TEXT(5, trace, relbuff); - if (buffer-state != BUF_STATE_LOCKED - buffer-state != BUF_STATE_PROCESSED) - BUG(); + BUG_ON(buffer-state != BUF_STATE_LOCKED + buffer-state != BUF_STATE_PROCESSED); spin_lock_irqsave(get_ccwdev_lock(channel-ccwdev), flags); buffer-state = BUF_STATE_EMPTY; spin_unlock_irqrestore(get_ccwdev_lock(channel-ccwdev), flags); -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/9] s390: Makefile cleanup
[PATCH 3/9] s390: Makefile cleanup From: Frank Pavlic [EMAIL PROTECTED] remove CONFIG_MPC from Makefile which was introduced accidently in the past. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/Makefile |1 - 1 files changed, 0 insertions(+), 1 deletions(-) bf825354b9a1839f8923d11a3b1b634fcc013c35 diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile index 6775a83..4777e36 100644 --- a/drivers/s390/net/Makefile +++ b/drivers/s390/net/Makefile @@ -10,7 +10,6 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o -obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o obj-$(CONFIG_QETH) += qeth.o -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/9] s390: netiucv driver fixes
[PATCH 2/9] s390: netiucv driver fixes From: Frank Pavlic [EMAIL PROTECTED] - missing lock initialization added - avoid duplicate iucv-interfaces to the same peer - rw-lock added for manipulating the list of defined iucv connections Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/netiucv.c | 80 +++- 1 files changed, 64 insertions(+), 16 deletions(-) 05eebe4adf2ad6b442b3dc0bd34ccc5863299efb diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 5d6e6cb..d7d1cc0 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -112,7 +112,12 @@ struct iucv_connection { /** * Linked list of all connection structs. */ -static struct iucv_connection *iucv_connections; +struct iucv_connection_struct { + struct iucv_connection *iucv_connections; + rwlock_t iucv_rwlock; +}; + +static struct iucv_connection_struct iucv_conns; /** * Representation of event-data for the @@ -1368,8 +1373,10 @@ user_write (struct device *dev, struct d struct net_device *ndev = priv-conn-netdev; char*p; char*tmp; - charusername[10]; + charusername[9]; int i; + struct iucv_connection **clist = iucv_conns.iucv_connections; + unsigned long flags; IUCV_DBF_TEXT(trace, 3, __FUNCTION__); if (count9) { @@ -1382,7 +1389,7 @@ user_write (struct device *dev, struct d tmp = strsep((char **) buf, \n); for (i=0, p=tmp; i8 *p; i++, p++) { if (isalnum(*p) || (*p == '$')) - username[i]= *p; + username[i]= toupper(*p); else if (*p == '\n') { /* trailing lf, grr */ break; @@ -1395,11 +1402,11 @@ user_write (struct device *dev, struct d return -EINVAL; } } - while (i9) + while (i8) username[i++] = ' '; - username[9] = '\0'; + username[8] = '\0'; - if (memcmp(username, priv-conn-userid, 8)) { + if (memcmp(username, priv-conn-userid, 9)) { /* username changed */ if (ndev-flags (IFF_UP | IFF_RUNNING)) { PRINT_WARN( @@ -1410,6 +1417,19 @@ user_write (struct device *dev, struct d return -EBUSY; } } + read_lock_irqsave(iucv_conns.iucv_rwlock, flags); + while (*clist) { +if (!strncmp(username, (*clist)-userid, 9) || + ((*clist)-netdev != ndev)) +break; +clist = ((*clist)-next); +} + read_unlock_irqrestore(iucv_conns.iucv_rwlock, flags); +if (*clist) { +PRINT_WARN(netiucv: Connection to %s already exists\n, +username); +return -EEXIST; +} memcpy(priv-conn-userid, username, 9); return count; @@ -1781,13 +1801,15 @@ netiucv_unregister_device(struct device static struct iucv_connection * netiucv_new_connection(struct net_device *dev, char *username) { - struct iucv_connection **clist = iucv_connections; + unsigned long flags; + struct iucv_connection **clist = iucv_conns.iucv_connections; struct iucv_connection *conn = kzalloc(sizeof(struct iucv_connection), GFP_KERNEL); if (conn) { skb_queue_head_init(conn-collect_queue); skb_queue_head_init(conn-commit_queue); + spin_lock_init(conn-collect_lock); conn-max_buffsize = NETIUCV_BUFSIZE_DEFAULT; conn-netdev = dev; @@ -1822,8 +1844,10 @@ netiucv_new_connection(struct net_device fsm_newstate(conn-fsm, CONN_STATE_STOPPED); } + write_lock_irqsave(iucv_conns.iucv_rwlock, flags); conn-next = *clist; *clist = conn; + write_unlock_irqrestore(iucv_conns.iucv_rwlock, flags); } return conn; } @@ -1835,14 +1859,17 @@ netiucv_new_connection(struct net_device static void netiucv_remove_connection(struct iucv_connection *conn) { - struct iucv_connection **clist = iucv_connections; + struct iucv_connection **clist = iucv_conns.iucv_connections; + unsigned long flags; IUCV_DBF_TEXT(trace, 3, __FUNCTION__); if (conn == NULL) return; + write_lock_irqsave(iucv_conns.iucv_rwlock, flags); while (*clist) { if (*clist == conn) { *clist = conn-next; + write_unlock_irqrestore(iucv_conns.iucv_rwlock, flags); if (conn-handle) { iucv_unregister_program(conn-handle); conn-handle = NULL; @@ -1855,6 +1882,7
[PATCH 6/9] s390: qeth driver fixes [3/6]
[PATCH 6/9] s390: qeth driver fixes [3/6] From: Frank Pavlic [EMAIL PROTECTED] fixed kernel panic caused by qeth driver: Using a bonding device qeth driver will realloc headroom for every skb coming from the bond device. Once this happens qeth frees the original skb and set the skb pointer to the new realloced skb. Under heavy transmit workload (e.g.UDP streams) through bond network device the qdio output queue might get full. In this case we return with EBUSY from qeth_send_packet. Returning to qeth_hard_start_xmit routine the skb address on the stack still points to the old address, which has been freed before. Returning from qeth_hard_start_xmit with EBUSY results in requeuing the skb. In this case it corrupts the qdisc queue and results in kernel panic. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth.h | 33 +++ drivers/s390/net/qeth_main.c | 193 ++ drivers/s390/net/qeth_tso.h |2 3 files changed, 113 insertions(+), 115 deletions(-) 80a8bd094c70579c027f15838501759ab8f3331d diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index e8bd8c5..c04ee91 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -859,23 +859,18 @@ qeth_get_ipa_adp_type(enum qeth_link_typ } } -static inline int -qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size) +static inline struct sk_buff * +qeth_realloc_headroom(struct qeth_card *card, struct sk_buff *skb, int size) { - struct sk_buff *new_skb = NULL; + struct sk_buff *new_skb = skb; - if (skb_headroom(*skb) size){ - new_skb = skb_realloc_headroom(*skb, size); - if (!new_skb) { -PRINT_ERR(qeth_prepare_skb: could - not realloc headroom for qeth_hdr - on interface %s, QETH_CARD_IFNAME(card)); -return -ENOMEM; -} - kfree_skb(*skb); -*skb = new_skb; - } - return 0; + if (skb_headroom(skb) = size) + return skb; + new_skb = skb_realloc_headroom(skb, size); + if (!new_skb) + PRINT_ERR(Could not realloc headroom for qeth_hdr + on interface %s, QETH_CARD_IFNAME(card)); + return new_skb; } static inline struct sk_buff * @@ -885,16 +880,15 @@ qeth_pskb_unshare(struct sk_buff *skb, i if (!skb_cloned(skb)) return skb; nskb = skb_copy(skb, pri); -kfree_skb(skb); /* free our shared copy */ return nskb; } static inline void * -qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size) +qeth_push_skb(struct qeth_card *card, struct sk_buff *skb, int size) { void *hdr; - hdr = (void *) skb_push(*skb, size); + hdr = (void *) skb_push(skb, size); /* * sanity check, the Linux memory allocation scheme should * never present us cases like this one (the qdio header size plus @@ -903,8 +897,7 @@ qeth_push_skb(struct qeth_card *card, st if unsigned long) hdr) (~(PAGE_SIZE - 1))) != (((unsigned long) hdr + size + QETH_IP_HEADER_SIZE) (~(PAGE_SIZE - 1 { -PRINT_ERR(qeth_prepare_skb: misaligned - packet on interface %s. Discarded., +PRINT_ERR(Misaligned packet on interface %s. Discarded., QETH_CARD_IFNAME(card)); return NULL; } diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 7a1..522fb9d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3919,49 +3919,59 @@ qeth_get_ip_version(struct sk_buff *skb) } } -static inline int -qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, -struct qeth_hdr **hdr, int ipv) +static inline struct qeth_hdr * +__qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, int ipv) { - int rc = 0; #ifdef CONFIG_QETH_VLAN u16 *tag; -#endif - - QETH_DBF_TEXT(trace, 6, prepskb); - if (card-info.type == QETH_CARD_TYPE_OSN) { - *hdr = (struct qeth_hdr *)(*skb)-data; - return rc; - } -rc = qeth_realloc_headroom(card, skb, sizeof(struct qeth_hdr)); -if (rc) -return rc; -#ifdef CONFIG_QETH_VLAN - if (card-vlangrp vlan_tx_tag_present(*skb) + if (card-vlangrp vlan_tx_tag_present(skb) ((ipv == 6) || card-options.layer2) ) { /* * Move the mac addresses (6 bytes src, 6 bytes dest) * to the beginning of the new header. We are using three * memcpys instead of one memmove
[PATCH 9/9] s390: qeth driver fixes [6/6]
[PATCH 9/9] s390: qeth driver fixes [6/6] From: Frank Pavlic [EMAIL PROTECTED] - Hipersockets has no IPV6 support, thus prevent issueing SETRTG_IPV6 control commands on Hipersockets devices. - fixed error handling in qeth_sysfs_(un)register Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 59 -- 1 files changed, 39 insertions(+), 20 deletions(-) bf4ddb14ce943f8e189655986107eadcc187dc8e diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index a1b2e6f..5613b45 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7344,6 +7344,8 @@ qeth_setrouting_v6(struct qeth_card *car QETH_DBF_TEXT(trace,3,setrtg6); #ifdef CONFIG_QETH_IPV6 + if (!qeth_is_supported(card, IPA_IPV6)) + return 0; qeth_correct_routing_type(card, card-options.route6.type, QETH_PROT_IPV6); @@ -8544,34 +8546,44 @@ qeth_ipv6_uninit(void) static void qeth_sysfs_unregister(void) { + s390_root_dev_unregister(qeth_root_dev); qeth_remove_driver_attributes(); ccw_driver_unregister(qeth_ccw_driver); ccwgroup_driver_unregister(qeth_ccwgroup_driver); - s390_root_dev_unregister(qeth_root_dev); } + /** * register qeth at sysfs */ static int qeth_sysfs_register(void) { - int rc=0; + int rc; rc = ccwgroup_driver_register(qeth_ccwgroup_driver); if (rc) - return rc; + goto out; + rc = ccw_driver_register(qeth_ccw_driver); if (rc) - return rc; + goto out_ccw_driver; + rc = qeth_create_driver_attributes(); if (rc) - return rc; + goto out_qeth_attr; + qeth_root_dev = s390_root_dev_register(qeth); - if (IS_ERR(qeth_root_dev)) { - rc = PTR_ERR(qeth_root_dev); - return rc; - } - return 0; + rc = IS_ERR(qeth_root_dev) ? PTR_ERR(qeth_root_dev) : 0; + if (!rc) + goto out; + + qeth_remove_driver_attributes(); +out_qeth_attr: + ccw_driver_unregister(qeth_ccw_driver); +out_ccw_driver: + ccwgroup_driver_unregister(qeth_ccwgroup_driver); +out: + return rc; } /*** @@ -8580,7 +8592,7 @@ qeth_sysfs_register(void) static int __init qeth_init(void) { - int rc=0; + int rc; PRINT_INFO(loading %s\n, version); @@ -8589,20 +8601,26 @@ qeth_init(void) spin_lock_init(qeth_notify_lock); rwlock_init(qeth_card_list.rwlock); - if (qeth_register_dbf_views()) + rc = qeth_register_dbf_views(); + if (rc) goto out_err; - if (qeth_sysfs_register()) - goto out_sysfs; + + rc = qeth_sysfs_register(); + if (rc) + goto out_dbf; #ifdef CONFIG_QETH_IPV6 - if (qeth_ipv6_init()) { - PRINT_ERR(Out of memory during ipv6 init.\n); + rc = qeth_ipv6_init(); + if (rc) { + PRINT_ERR(Out of memory during ipv6 init code = %d\n, rc); goto out_sysfs; } #endif /* QETH_IPV6 */ - if (qeth_register_notifiers()) + rc = qeth_register_notifiers(); + if (rc) goto out_ipv6; - if (qeth_create_procfs_entries()) + rc = qeth_create_procfs_entries(); + if (rc) goto out_notifiers; return rc; @@ -8612,12 +8630,13 @@ out_notifiers: out_ipv6: #ifdef CONFIG_QETH_IPV6 qeth_ipv6_uninit(); -#endif /* QETH_IPV6 */ out_sysfs: +#endif /* QETH_IPV6 */ qeth_sysfs_unregister(); +out_dbf: qeth_unregister_dbf_views(); out_err: - PRINT_ERR(Initialization failed); + PRINT_ERR(Initialization failed with code %d\n, rc); return rc; } -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/9] s390: qeth driver fixes [4/6]
[PATCH 7/9] s390: qeth driver fixes [4/6] From: Frank Pavlic [EMAIL PROTECTED] - fix kernel crash due to race, set card-state to SOFTSETUP after card and card-dev are initialized properly. - remove CONFIG_QETH_PERF_STATS, use sysfs attribute instead, as we want to have the ability to turn on/off the statistics at runtime. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/Kconfig |9 --- drivers/s390/net/qeth.h | 10 +-- drivers/s390/net/qeth_eddp.c |5 + drivers/s390/net/qeth_main.c | 147 -- drivers/s390/net/qeth_proc.c | 23 +++ drivers/s390/net/qeth_sys.c | 42 6 files changed, 128 insertions(+), 108 deletions(-) 1068b773a870931ccec7009a320e37f7013b268f diff --git a/drivers/s390/net/Kconfig b/drivers/s390/net/Kconfig index 5488547..1a93fa6 100644 --- a/drivers/s390/net/Kconfig +++ b/drivers/s390/net/Kconfig @@ -92,15 +92,6 @@ config QETH_VLAN If CONFIG_QETH is switched on, this option will include IEEE 802.1q VLAN support in the qeth device driver. -config QETH_PERF_STATS - bool Performance statistics in /proc - depends on QETH - help - When switched on, this option will add a file in the proc-fs - (/proc/qeth_perf_stats) containing performance statistics. It - may slightly impact performance, so this is only recommended for - internal tuning of the device driver. - config CCWGROUP tristate default (LCS || CTC || QETH) diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index c04ee91..22a7ffb 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -176,7 +176,6 @@ extern struct ccwgroup_driver qeth_ccwgr /** * card stuff */ -#ifdef CONFIG_QETH_PERF_STATS struct qeth_perf_stats { unsigned int bufs_rec; unsigned int bufs_sent; @@ -211,8 +210,10 @@ struct qeth_perf_stats { unsigned int large_send_cnt; unsigned int sg_skbs_sent; unsigned int sg_frags_sent; + /* initial values when measuring starts */ + unsigned long initial_rx_packets; + unsigned long initial_tx_packets; }; -#endif /* CONFIG_QETH_PERF_STATS */ /* Routing stuff */ struct qeth_routing_info { @@ -767,6 +768,7 @@ struct qeth_card_options { int fake_ll; int layer2; enum qeth_large_send_types large_send; + int performance_stats; }; /* @@ -819,9 +821,7 @@ struct qeth_card { struct list_head cmd_waiter_list; /* QDIO buffer handling */ struct qeth_qdio_info qdio; -#ifdef CONFIG_QETH_PERF_STATS struct qeth_perf_stats perf_stats; -#endif /* CONFIG_QETH_PERF_STATS */ int use_hard_stop; int (*orig_hard_header)(struct sk_buff *,struct net_device *, unsigned short,void *,void *,unsigned); @@ -1049,13 +1049,11 @@ qeth_get_arphdr_type(int cardtype, int l } } -#ifdef CONFIG_QETH_PERF_STATS static inline int qeth_get_micros(void) { return (int) (get_clock() 12); } -#endif static inline int qeth_get_qdio_q_format(struct qeth_card *card) diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 8491598..a363721 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -179,9 +179,8 @@ out_check: flush_cnt++; } } else { -#ifdef CONFIG_QETH_PERF_STATS - queue-card-perf_stats.skbs_sent_pack++; -#endif + if (queue-card-options.performance_stats) + queue-card-perf_stats.skbs_sent_pack++; QETH_DBF_TEXT(trace, 6, fillbfpa); if (buf-next_element_to_fill = QETH_MAX_BUFFER_ELEMENTS(queue-card)) { diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 522fb9d..0bc55a3 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1073,6 +1073,7 @@ qeth_set_intial_options(struct qeth_card card-options.layer2 = 1; else card-options.layer2 = 0; + card-options.performance_stats = 1; } /** @@ -2564,9 +2565,8 @@ qeth_process_inbound_buffer(struct qeth_ /* get first element of current buffer */ element = (struct qdio_buffer_element *)buf-buffer-element[0]; offset = 0; -#ifdef CONFIG_QETH_PERF_STATS - card-perf_stats.bufs_rec++; -#endif + if (card-options.performance_stats) + card-perf_stats.bufs_rec++; while((skb = qeth_get_next_skb(card, buf-buffer, element, offset, hdr))) { skb-dev = card-dev; @@ -2623,7 +2623,7 @@ qeth_init_input_buffer(struct qeth_card { struct qeth_buffer_pool_entry *pool_entry; int i; - + pool_entry = qeth_get_buffer_pool_entry(card
Re: [PATCH 6/9] s390: qeth driver fixes [3/6]
yes it would but the problem in qeth is not only bonding related. We just have found it in a bonding scenario . But this kernel panic could also occur without bonding. But thanks for reviewing it On Fri, Sep 15, 2006 at 08:51:25AM -0700, Jay Vosburgh wrote: Frank Pavlic [EMAIL PROTECTED] wrote: [PATCH 6/9] s390: qeth driver fixes [3/6] From: Frank Pavlic [EMAIL PROTECTED] fixed kernel panic caused by qeth driver: Using a bonding device qeth driver will realloc headroom for every skb coming from the bond device. Once this happens qeth frees the original skb and set the skb pointer to the new realloced skb. Frank, does the following patch to bonding (to track larger than usual hard_header_len) resolve this problem without changing qeth? I believe this patch is queued for 2.6.19. To: netdev@vger.kernel.org, [EMAIL PROTECTED] Cc: Jeff Garzik [EMAIL PROTECTED] Subject: [PATCH 5/7] bonding: Handle large hard_header_len X-Mailer: MH-E 7.83; nmh 1.1-RC4; GNU Emacs 21.4.1 Date: Fri, 01 Sep 2006 15:12:44 -0700 From: Jay Vosburgh [EMAIL PROTECTED] The bonding driver fails to adjust its hard_header_len when enslaving interfaces. Whenever an interface with a hard_header_len greater than the ETH_HLEN default is enslaved, the potential for an oops exists, and if the oops happens while responding to an arp request, for example, the system panics. GIANFAR devices may use an extended hard_header for VLAN or hardware checksumming. Enslaving such a device and then transmitting over it causes a kernel panic. Patch modified from submitter's original, but submitter agreed with this patch in private email. Signed-off-by: Mark Huth [EMAIL PROTECTED] Signed-off-by: Jay Vosburgh [EMAIL PROTECTED] --- netdev-2.6.git-upstream/drivers/net/bonding/bond_main.c 2006/08/19 14:46:07 1.3 +++ netdev-2.6.git-upstream/drivers/net/bonding/bond_main.c 2006/08/19 15:47:27 1.4 @@ -1211,10 +1211,14 @@ static int bond_compute_features(struct unsigned long features = BOND_INTERSECT_FEATURES; struct slave *slave; struct net_device *bond_dev = bond-dev; + unsigned short max_hard_header_len = ETH_HLEN; int i; - bond_for_each_slave(bond, slave, i) + bond_for_each_slave(bond, slave, i) { features = (slave-dev-features BOND_INTERSECT_FEATURES); + if (slave-dev-hard_header_len max_hard_header_len) + max_hard_header_len = slave-dev-hard_header_len; + } if ((features NETIF_F_SG) !(features NETIF_F_ALL_CSUM)) @@ -1232,6 +1236,7 @@ static int bond_compute_features(struct features |= (bond_dev-features ~BOND_INTERSECT_FEATURES); bond_dev-features = features; + bond_dev-hard_header_len = max_hard_header_len; return 0; } -J --- -Jay Vosburgh, IBM Linux Technology Center, [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/5] s390: qeth driver fixes
From: Ursula Braun [EMAIL PROTECTED] From: Frank Pavlic [EMAIL PROTECTED] - correct checking of sscanf-%n value in qeth_string_to_ipaddr(). - don't use netif_stop_queue outside the hard_start_xmit routine. Rather use netif_tx_disable. - don't call qeth_netdev_init on a recovery. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth.h |2 +- drivers/s390/net/qeth_main.c | 22 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) ef153db1ac07db7ec4eba2ec29237c58944b5c7b diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 4df0fcd..65e2b1b 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h @@ -1099,7 +1099,7 @@ qeth_string_to_ipaddr4(const char *buf, rc = sscanf(buf, %d.%d.%d.%d%n, in[0], in[1], in[2], in[3], count); - if (rc != 4 || count) + if (rc != 4 || count=0) return -EINVAL; for (count = 0; count 4; count++) { if (in[count] 255) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index cb14642..0f6648f 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev) card = (struct qeth_card *) dev-priv; - netif_stop_queue(dev); + netif_tx_disable(dev); card-dev-flags = ~IFF_UP; if (card-state == CARD_STATE_UP) card-state = CARD_STATE_SOFTSETUP; @@ -6359,12 +6359,9 @@ qeth_netdev_init(struct net_device *dev) dev-vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; dev-vlan_rx_add_vid = qeth_vlan_rx_add_vid; #endif - dev-hard_header = card-orig_hard_header; if (qeth_get_netdev_flags(card) IFF_NOARP) { dev-rebuild_header = NULL; dev-hard_header = NULL; - if (card-options.fake_ll) - dev-hard_header = qeth_fake_header; dev-header_cache_update = NULL; dev-hard_header_cache = NULL; } @@ -6477,6 +6474,9 @@ retry: /*network device will be recovered*/ if (card-dev) { card-dev-hard_header = card-orig_hard_header; + if (card-options.fake_ll + (qeth_get_netdev_flags(card) IFF_NOARP)) + card-dev-hard_header = qeth_fake_header; return 0; } /* at first set_online allocate netdev */ @@ -7031,7 +7031,7 @@ qeth_softsetup_ipv6(struct qeth_card *ca QETH_DBF_TEXT(trace,3,softipv6); - netif_stop_queue(card-dev); + netif_tx_disable(card-dev); rc = qeth_send_startlan(card, QETH_PROT_IPV6); if (rc) { PRINT_ERR(IPv6 startlan failed on %s\n, @@ -7352,7 +7352,8 @@ qeth_set_large_send(struct qeth_card *ca card-options.large_send = type; return 0; } - netif_stop_queue(card-dev); + if (card-state == CARD_STATE_UP) + netif_tx_disable(card-dev); card-options.large_send = type; switch (card-options.large_send) { case QETH_LARGE_SEND_EDDP: @@ -7374,7 +7375,8 @@ qeth_set_large_send(struct qeth_card *ca card-dev-features = ~(NETIF_F_TSO | NETIF_F_SG); break; } - netif_wake_queue(card-dev); + if (card-state == CARD_STATE_UP) + netif_wake_queue(card-dev); return rc; } @@ -7427,7 +7429,7 @@ qeth_softsetup_card(struct qeth_card *ca if ((rc = qeth_setrouting_v6(card))) QETH_DBF_TEXT_(setup, 2, 5err%d, rc); out: - netif_stop_queue(card-dev); + netif_tx_disable(card-dev); return 0; } @@ -7736,10 +7738,8 @@ static int qeth_register_netdev(struct qeth_card *card) { QETH_DBF_TEXT(setup, 3, regnetd); - if (card-dev-reg_state != NETREG_UNINITIALIZED) { - qeth_netdev_init(card-dev); + if (card-dev-reg_state != NETREG_UNINITIALIZED) return 0; - } /* sysfs magic */ SET_NETDEV_DEV(card-dev, card-gdev-dev); return register_netdev(card-dev); -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/5] s390: minor fix in cu3088
Hi Jeff, please apply following 5 patches. Thanks ... Frank From: Cornelia Huck [EMAIL PROTECTED] In case of a parse error for the cu3088 group attribute, return -EINVAL instead of count. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/cu3088.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 99e5e7d1a3245f4416290a336bc9fc8107d05d5e diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c index b125331..e1b8c9a 100644 --- a/drivers/s390/net/cu3088.c +++ b/drivers/s390/net/cu3088.c @@ -77,7 +77,7 @@ group_write(struct device_driver *drv, c int len; if (!(end = strchr(start, delim[i]))) - return count; + return -EINVAL; len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); strlcpy (bus_ids[i], start, len); argv[i] = bus_ids[i]; -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/5] s390: lcs driver bug fixes and improvements [1/2]
From: Klaus Wacker [EMAIL PROTECTED] Several problems occured with lcs device driver: - device not operational anymore after cable pull/plug-in. - unpredictable results occured, e.g. kernel panic using cards of type QD8F. - STOPLAN and delete multicast address command were not proper recognized by OSA card under heavy network workload. - channel/device error checks missing in interrupt handler. To fix all problems at once recovery of lcs devices has been improved. missing error checks in lcs interrupt handler has been added. Once a hardware problem occurs lcs will recover the device now properly. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/lcs.c | 341 1 files changed, 171 insertions(+), 170 deletions(-) c9db4a2d4c97370d5a65ef0654342052c80ed7a2 diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index e65da92..c915bb5 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -68,6 +68,7 @@ static void lcs_tasklet(unsigned long); static void lcs_start_kernel_thread(struct lcs_card *card); static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); +static int lcs_recovery(void *ptr); /** * Debug Facility Stuff @@ -429,12 +430,6 @@ lcs_setup_card(struct lcs_card *card) card-tx_buffer = NULL; card-tx_emitted = 0; - /* Initialize kernel thread task used for LGW commands. */ - INIT_WORK(card-kernel_thread_starter, - (void *)lcs_start_kernel_thread,card); - card-thread_start_mask = 0; - card-thread_allowed_mask = 0; - card-thread_running_mask = 0; init_waitqueue_head(card-wait_q); spin_lock_init(card-lock); spin_lock_init(card-ipm_lock); @@ -675,8 +670,9 @@ lcs_ready_buffer(struct lcs_channel *cha int index, rc; LCS_DBF_TEXT(5, trace, rdybuff); - BUG_ON(buffer-state != BUF_STATE_LOCKED - buffer-state != BUF_STATE_PROCESSED); + if (buffer-state != BUF_STATE_LOCKED + buffer-state != BUF_STATE_PROCESSED) + BUG(); spin_lock_irqsave(get_ccwdev_lock(channel-ccwdev), flags); buffer-state = BUF_STATE_READY; index = buffer - channel-iob; @@ -700,7 +696,8 @@ __lcs_processed_buffer(struct lcs_channe int index, prev, next; LCS_DBF_TEXT(5, trace, prcsbuff); - BUG_ON(buffer-state != BUF_STATE_READY); + if (buffer-state != BUF_STATE_READY) + BUG(); buffer-state = BUF_STATE_PROCESSED; index = buffer - channel-iob; prev = (index - 1) (LCS_NUM_BUFFS - 1); @@ -732,8 +729,9 @@ lcs_release_buffer(struct lcs_channel *c unsigned long flags; LCS_DBF_TEXT(5, trace, relbuff); - BUG_ON(buffer-state != BUF_STATE_LOCKED - buffer-state != BUF_STATE_PROCESSED); + if (buffer-state != BUF_STATE_LOCKED + buffer-state != BUF_STATE_PROCESSED) + BUG(); spin_lock_irqsave(get_ccwdev_lock(channel-ccwdev), flags); buffer-state = BUF_STATE_EMPTY; spin_unlock_irqrestore(get_ccwdev_lock(channel-ccwdev), flags); @@ -1147,8 +1145,6 @@ list_modified: list_add_tail(ipm-list, card-ipm_list); } spin_unlock_irqrestore(card-ipm_lock, flags); - if (card-state == DEV_STATE_UP) - netif_wake_queue(card-dev); } /** @@ -1231,17 +1227,17 @@ lcs_set_mc_addresses(struct lcs_card *ca if (ipm != NULL) continue; /* Address already in list. */ ipm = (struct lcs_ipm_list *) - kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); + kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); if (ipm == NULL) { PRINT_INFO(Not enough memory to add new multicast entry!\n); break; } - memset(ipm, 0, sizeof(struct lcs_ipm_list)); memcpy(ipm-ipm.mac_addr, buf, LCS_MAC_LENGTH); ipm-ipm.ip_addr = im4-multiaddr; ipm-ipm_state = LCS_IPM_STATE_SET_REQUIRED; spin_lock_irqsave(card-ipm_lock, flags); + LCS_DBF_HEX(2,trace,ipm-ipm.ip_addr,4); list_add(ipm-list, card-ipm_list); spin_unlock_irqrestore(card-ipm_lock, flags); } @@ -1269,7 +1265,15 @@ lcs_register_mc_addresses(void *data) read_unlock(in4_dev-mc_list_lock); in_dev_put(in4_dev); + netif_carrier_off(card-dev); + netif_tx_disable(card-dev); + wait_event(card-write.wait_q, + (card-write.state != CH_STATE_RUNNING)); lcs_fix_multicast_list(card); + if (card-state
[PATCH 5/5] s390: lcs driver bug fixes and improvements [2/2]
From: Klaus Wacker [EMAIL PROTECTED] This is the second lcs driver patch containing the rest of lcs fixes. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/lcs.h | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) 6956e921ffef4871ce2d422cbcbdad863f7ab0b3 diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index 2fad5e4..9314393 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h @@ -73,13 +73,17 @@ do { /** * LCS sense byte definitions */ +#define LCS_SENSE_BYTE_0 0 +#define LCS_SENSE_BYTE_1 1 +#define LCS_SENSE_BYTE_2 2 +#define LCS_SENSE_BYTE_3 3 #define LCS_SENSE_INTERFACE_DISCONNECT 0x01 #define LCS_SENSE_EQUIPMENT_CHECK 0x10 #define LCS_SENSE_BUS_OUT_CHECK0x20 #define LCS_SENSE_INTERVENTION_REQUIRED 0x40 #define LCS_SENSE_CMD_REJECT 0x80 -#define LCS_SENSE_RESETTING_EVENT 0x0080 -#define LCS_SENSE_DEVICE_ONLINE0x0020 +#define LCS_SENSE_RESETTING_EVENT 0x80 +#define LCS_SENSE_DEVICE_ONLINE0x20 /** * LCS packet type definitions @@ -152,10 +156,9 @@ enum lcs_dev_states { enum lcs_threads { LCS_SET_MC_THREAD = 1, - LCS_STARTLAN_THREAD = 2, - LCS_STOPLAN_THREAD = 4, - LCS_STARTUP_THREAD = 8, + LCS_RECOVERY_THREAD = 2, }; + /** * LCS struct declarations */ @@ -286,6 +289,7 @@ struct lcs_card { struct net_device_stats stats; unsigned short (*lan_type_trans)(struct sk_buff *skb, struct net_device *dev); + struct ccwgroup_device *gdev; struct lcs_channel read; struct lcs_channel write; struct lcs_buffer *tx_buffer; -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] s390: qeth driver fixes
From: Ursula Braun [EMAIL PROTECTED] From: Frank Blaschka [EMAIL PROTECTED] From: Frank Pavlic [EMAIL PROTECTED] - fix fake_ll during initial device bringup. fake_ll was not active after first start of the device. Problem only occured when qeth was built without IPV6 support. - avoid skb usage after invocation of qeth_flush_buffers, because skb might already be freed. - remove yet another useless netif_wake_queue in qeth_softsetup_ipv6 since this function is only called when device is going online. In this case card-state will never be in state UP. So let the net_device queue down . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/qeth_main.c | 23 +-- 1 files changed, 13 insertions(+), 10 deletions(-) e32bb8db95c84a0af8c5688b92ed6691982e4f9c diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 0f6648f..9dbb5be 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -3798,11 +3798,11 @@ qeth_open(struct net_device *dev) QETH_DBF_TEXT(trace,4,nomacadr); return -EPERM; } - card-dev-flags |= IFF_UP; - netif_start_queue(dev); card-data.state = CH_STATE_UP; card-state = CARD_STATE_UP; - + card-dev-flags |= IFF_UP; + netif_start_queue(dev); + if (!card-lan_online netif_carrier_ok(dev)) netif_carrier_off(dev); return 0; @@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, #endif *hdr = (struct qeth_hdr *) qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); - if (hdr == NULL) + if (*hdr == NULL) return -EINVAL; return 0; } @@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; int tx_bytes = skb-len; + unsigned short nr_frags = skb_shinfo(skb)-nr_frags; + unsigned short tso_size = skb_shinfo(skb)-tso_size; int rc; QETH_DBF_TEXT(trace, 6, sendpkt); @@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, card-stats.tx_packets++; card-stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS - if (skb_shinfo(skb)-tso_size + if (tso_size !(large_send == QETH_LARGE_SEND_NO)) { - card-perf_stats.large_send_bytes += skb-len; + card-perf_stats.large_send_bytes += tx_bytes; card-perf_stats.large_send_cnt++; } - if (skb_shinfo(skb)-nr_frags 0){ + if (nr_frags 0){ card-perf_stats.sg_skbs_sent++; /* nr_frags + skb-data */ card-perf_stats.sg_frags_sent += - skb_shinfo(skb)-nr_frags + 1; + nr_frags + 1; } #endif /* CONFIG_QETH_PERF_STATS */ } @@ -6370,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev) if (!(card-info.unique_id UNIQUE_ID_NOT_BY_CARD)) card-dev-dev_id = card-info.unique_id 0x; #endif + if (card-options.fake_ll + (qeth_get_netdev_flags(card) IFF_NOARP)) + dev-hard_header = qeth_fake_header; dev-hard_header_parse = NULL; dev-set_mac_address = qeth_layer2_set_mac_address; dev-flags |= qeth_get_netdev_flags(card); @@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *ca QETH_DBF_TEXT(trace,3,softipv6); - netif_tx_disable(card-dev); rc = qeth_send_startlan(card, QETH_PROT_IPV6); if (rc) { PRINT_ERR(IPv6 startlan failed on %s\n, QETH_CARD_IFNAME(card)); return rc; } - netif_wake_queue(card-dev); rc = qeth_query_ipassists(card,QETH_PROT_IPV6); if (rc) { PRINT_ERR(IPv6 query ipassist failed on %s\n, -- 1.2.4 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RESEND PATCH 2/2] s390: remove tty support from ctc network device driver [2/2]
Hi, here comes the second of the two patches ... Frank From: Peter Tiedemann [EMAIL PROTECTED] [2/2]: remove ctctty.c and ctctty.h files . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/ctctty.c | 1259 - drivers/s390/net/ctctty.h | 35 - 2 files changed, 0 insertions(+), 1294 deletions(-) delete mode 100644 drivers/s390/net/ctctty.c delete mode 100644 drivers/s390/net/ctctty.h aec009cf604020403752ed0c0826e0e2e83295e1 diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c deleted file mode 100644 index 5cdcdbf..000 --- a/drivers/s390/net/ctctty.c +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * CTC / ESCON network driver, tty interface. - * - * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Fritz Elfert ([EMAIL PROTECTED], [EMAIL PROTECTED]) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include linux/config.h -#include linux/module.h -#include linux/tty.h -#include linux/tty_flip.h -#include linux/serial_reg.h -#include linux/interrupt.h -#include linux/delay.h -#include asm/uaccess.h -#include linux/devfs_fs_kernel.h -#include ctctty.h -#include ctcdbug.h - -#define CTC_TTY_MAJOR 43 -#define CTC_TTY_MAX_DEVICES 64 - -#define CTC_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking*/ -#define CTC_ASYNC_INITIALIZED0x8000 /* port was initialized */ -#define CTC_ASYNC_NORMAL_ACTIVE 0x2000 /* Normal device active */ -#define CTC_ASYNC_CLOSING0x0800 /* Serial port is closing */ -#define CTC_ASYNC_CTS_FLOW 0x0400 /* Do CTS flow control */ -#define CTC_ASYNC_CHECK_CD 0x0200 /* i.e., CLOCAL */ -#define CTC_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */ -#define CTC_ASYNC_NETDEV_OPEN0x0002 /* Underlying netdev is open*/ -#define CTC_ASYNC_TX_LINESTAT0x0004 /* Must send line status*/ -#define CTC_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define CTC_TTY_XMIT_SIZE 1024 /* Default bufsize for write*/ -#define CTC_SERIAL_XMIT_MAX4000 /* Maximum bufsize for write*/ - -/* Private data (similar to async_struct in linux/serial.h) */ -typedef struct { - int magic; - int flags; /* defined in tty.h */ - int mcr; /* Modem control register */ - int msr; /* Modem status register */ - int lsr; /* Line status register */ - int line; - int count; /* # of fd on device */ - int blocked_open;/* # of blocked opens */ - struct net_device *netdev; - struct sk_buff_head tx_queue;/* transmit queue */ - struct sk_buff_head rx_queue;/* receive queue */ - struct tty_struct*tty;/* Pointer to corresponding tty */ - wait_queue_head_topen_wait; - wait_queue_head_tclose_wait; - struct semaphore write_sem; - struct tasklet_struct tasklet; - struct timer_list stoptimer; -} ctc_tty_info; - -/* Description of one CTC-tty */ -typedef struct { - struct tty_driver *ctc_tty_device; /* tty-device */ - ctc_tty_info info[CTC_TTY_MAX_DEVICES]; /* Private data */ -} ctc_tty_driver; - -static ctc_tty_driver *driver; - -/* Leave this unchanged unless you know what you do! */ -#define MODEM_PARANOIA_CHECK -#define MODEM_DO_RESTART - -#define CTC_TTY_NAME ctctty - -static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC; -static int ctc_tty_shuttingdown = 0; - -static spinlock_t ctc_tty_lock; - -/* ctc_tty_try_read() is called from within ctc_tty_rcv_skb() - * to stuff incoming data directly into a tty's flip-buffer. If the - * flip buffer is full, the packet gets queued up. - * - * Return: - * 1 = Success - * 0 = Failure, data has to be buffered and later processed by - * ctc_tty_readmodem(). - */ -static int -ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) -{ - int len; - struct tty_struct *tty; - - DBF_TEXT(trace, 5
[PATCH RESEND 1/2] s390: remove tty support from ctc network device driver [1/2]
Hi jeff, after the first shot I sent to you did not apply I resend two new patches I've made today to remove tty from ctc network driver. Please apply Thank you ... Frank From: Peter Tiedemann [EMAIL PROTECTED] [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] --- drivers/s390/net/Makefile |3 ++- drivers/s390/net/ctcmain.c | 45 +--- drivers/s390/net/ctcmain.h | 12 +--- 3 files changed, 16 insertions(+), 44 deletions(-) fd1e8730b620e901a223034aaa6d97dde7a63b56 diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile index 90d4d0e..6775a83 100644 --- a/drivers/s390/net/Makefile +++ b/drivers/s390/net/Makefile @@ -2,7 +2,7 @@ # S/390 network devices # -ctc-objs := ctcmain.o ctctty.o ctcdbug.o +ctc-objs := ctcmain.o ctcdbug.o obj-$(CONFIG_IUCV) += iucv.o obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o @@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o +obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o obj-$(CONFIG_QETH) += qeth.o diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212..e2ccaf5 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -6,7 +6,7 @@ * Fixes by : Jochen Röhrig ([EMAIL PROTECTED]) *Arnaldo Carvalho de Melo [EMAIL PROTECTED] Peter Tiedemann ([EMAIL PROTECTED]) - * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] + * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -65,7 +65,6 @@ #include asm/idals.h -#include ctctty.h #include fsm.h #include cu3088.h @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struc skb-dev = pskb-dev; skb-protocol = pskb-protocol; pskb-ip_summed = CHECKSUM_UNNECESSARY; - if (ch-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_ni(skb); /** * Successful rx; reset logflags */ @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsig DBF_TEXT(trace, 5, __FUNCTION__); if (sense SNS0_INTERVENTION_REQ) { if (sense 0x01) { - if (ch-protocol != CTC_PROTO_LINUX_TTY) - ctc_pr_debug(%s: Interface disc. or Sel. reset + ctc_pr_debug(%s: Interface disc. or Sel. reset (remote)\n, ch-id); fsm_event(ch-fsm, CH_EVENT_UC_RCRESET, ch); } else { @@ -2034,7 +2029,6 @@ static void dev_action_chup(fsm_instance * fi, int event, void *arg) { struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int e static void dev_action_chdown(fsm_instance * fi, int event, void *arg) { - struct net_device *dev = (struct net_device *) arg
Re: [patch 2/6] s390: qeth driver statistics fixes
On Wed, 22 Mar 2006 20:30:31 -0500 Jeff Garzik [EMAIL PROTECTED] wrote: Frank Pavlic wrote: [patch 2/6] s390: qeth driver statistics fixes From: Ursula Braun [EMAIL PROTECTED] - display unsigned int values in /proc/qeth_perf with %u instead of %i - omit qdio header length when increasing card-stats.tx_bytes Signed-off-by: Frank Pavlic [EMAIL PROTECTED] applied 2-4 I am OK with removing tty from network driver (patches 5-6), but they didn't apply hmm ok , I have built new ones today ... Let me know if you still run into problems to apply the new two ctc tty removal patches... Thanks Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RESEND patch 6/6] s390: remove tty support from ctc network device driver [2/2]
[patch 6/6] s390: remove tty support from ctc network device driver [2/2] From: Peter Tiedemann [EMAIL PROTECTED] [2/2]: remove ctctty.c and ctctty.h files . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: drivers/s390/net/ctctty.c | 1259 - drivers/s390/net/ctctty.h | 35 - 2 files changed, 0 insertions(+), 1294 deletions(-) delete mode 100644 drivers/s390/net/ctctty.c delete mode 100644 drivers/s390/net/ctctty.h 5849a244ec8f32fe4dbbb8212cb48dc688e7a17d diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c deleted file mode 100644 index 5cdcdbf..000 --- a/drivers/s390/net/ctctty.c +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * CTC / ESCON network driver, tty interface. - * - * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Fritz Elfert ([EMAIL PROTECTED], [EMAIL PROTECTED]) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include linux/config.h -#include linux/module.h -#include linux/tty.h -#include linux/tty_flip.h -#include linux/serial_reg.h -#include linux/interrupt.h -#include linux/delay.h -#include asm/uaccess.h -#include linux/devfs_fs_kernel.h -#include ctctty.h -#include ctcdbug.h - -#define CTC_TTY_MAJOR 43 -#define CTC_TTY_MAX_DEVICES 64 - -#define CTC_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking*/ -#define CTC_ASYNC_INITIALIZED0x8000 /* port was initialized */ -#define CTC_ASYNC_NORMAL_ACTIVE 0x2000 /* Normal device active */ -#define CTC_ASYNC_CLOSING0x0800 /* Serial port is closing */ -#define CTC_ASYNC_CTS_FLOW 0x0400 /* Do CTS flow control */ -#define CTC_ASYNC_CHECK_CD 0x0200 /* i.e., CLOCAL */ -#define CTC_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */ -#define CTC_ASYNC_NETDEV_OPEN0x0002 /* Underlying netdev is open*/ -#define CTC_ASYNC_TX_LINESTAT0x0004 /* Must send line status*/ -#define CTC_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define CTC_TTY_XMIT_SIZE 1024 /* Default bufsize for write*/ -#define CTC_SERIAL_XMIT_MAX4000 /* Maximum bufsize for write*/ - -/* Private data (similar to async_struct in linux/serial.h) */ -typedef struct { - int magic; - int flags; /* defined in tty.h */ - int mcr; /* Modem control register */ - int msr; /* Modem status register */ - int lsr; /* Line status register */ - int line; - int count; /* # of fd on device */ - int blocked_open;/* # of blocked opens */ - struct net_device *netdev; - struct sk_buff_head tx_queue;/* transmit queue */ - struct sk_buff_head rx_queue;/* receive queue */ - struct tty_struct*tty;/* Pointer to corresponding tty */ - wait_queue_head_topen_wait; - wait_queue_head_tclose_wait; - struct semaphore write_sem; - struct tasklet_struct tasklet; - struct timer_list stoptimer; -} ctc_tty_info; - -/* Description of one CTC-tty */ -typedef struct { - struct tty_driver *ctc_tty_device; /* tty-device */ - ctc_tty_info info[CTC_TTY_MAX_DEVICES]; /* Private data */ -} ctc_tty_driver; - -static ctc_tty_driver *driver; - -/* Leave this unchanged unless you know what you do! */ -#define MODEM_PARANOIA_CHECK -#define MODEM_DO_RESTART - -#define CTC_TTY_NAME ctctty - -static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC; -static int ctc_tty_shuttingdown = 0; - -static spinlock_t ctc_tty_lock; - -/* ctc_tty_try_read() is called from within ctc_tty_rcv_skb() - * to stuff incoming data directly into a tty's flip-buffer. If the - * flip buffer is full, the packet gets queued up. - * - * Return: - * 1 = Success - * 0 = Failure, data has to be buffered and later processed by - * ctc_tty_readmodem(). - */ -static int -ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) -{ - int len; - struct tty_struct *tty
[RESEND patch 5/6] s390: remove tty support from ctc network device driver [1/2]
[patch 5/6] s390: remove tty support from ctc network device driver [1/2] From: Peter Tiedemann [EMAIL PROTECTED] [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: Makefile |3 ++- ctcmain.c | 45 + ctcmain.h | 12 +--- 3 files changed, 16 insertions(+), 44 deletions(-) diff -Naupr git-linux/drivers/s390/net/ctcmain.c git-patched/drivers/s390/net/ctcmain.c --- git-linux/drivers/s390/net/ctcmain.c2006-03-24 09:21:59.0 +0100 +++ git-patched/drivers/s390/net/ctcmain.c 2006-03-24 09:41:17.0 +0100 @@ -6,7 +6,7 @@ * Fixes by : Jochen Röhrig ([EMAIL PROTECTED]) *Arnaldo Carvalho de Melo [EMAIL PROTECTED] Peter Tiedemann ([EMAIL PROTECTED]) - * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] + * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -65,7 +65,6 @@ #include asm/idals.h -#include ctctty.h #include fsm.h #include cu3088.h @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struc skb-dev = pskb-dev; skb-protocol = pskb-protocol; pskb-ip_summed = CHECKSUM_UNNECESSARY; - if (ch-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_ni(skb); /** * Successful rx; reset logflags */ @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsig DBF_TEXT(trace, 5, __FUNCTION__); if (sense SNS0_INTERVENTION_REQ) { if (sense 0x01) { - if (ch-protocol != CTC_PROTO_LINUX_TTY) - ctc_pr_debug(%s: Interface disc. or Sel. reset + ctc_pr_debug(%s: Interface disc. or Sel. reset (remote)\n, ch-id); fsm_event(ch-fsm, CH_EVENT_UC_RCRESET, ch); } else { @@ -2034,7 +2029,6 @@ static void dev_action_chup(fsm_instance * fi, int event, void *arg) { struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int e static void dev_action_chdown(fsm_instance * fi, int event, void *arg) { - struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { case DEV_STATE_RUNNING: - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 0); if (event == DEV_EVENT_TXDOWN) fsm_newstate(fi, DEV_STATE_STARTWAIT_TX); else @@ -2397,8 +2383,6 @@ ctc_tx(struct sk_buff *skb, struct net_d */ if (fsm_getstate(privptr-fsm) != DEV_STATE_RUNNING) { fsm_event(privptr-fsm, DEV_EVENT_START, dev); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - return -EBUSY; dev_kfree_skb(skb
[patch 1/6] s390: minor claw driver fix
Hi , following 6 patches are for s390 network drivers claw, qeth and ctc. tty support will be removed from the ctc network device driver , which will happen with patch 5/6 and 6/6 . The latter one will remove two files , ctctty.c and ctctty.h . Thanks Frank [patch 1/6] s390: minor claw driver fix From: Frank Pavlic [EMAIL PROTECTED] use CONFIG_ARCH_S390X instead of CONFIG_64BIT in function dumpit . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: claw.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index a86436a..4687bb5 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -1601,7 +1601,7 @@ dumpit(char* buf, int len) __u32 ct, sw, rm, dup; char *ptr, *rptr; char tbuf[82], tdup[82]; -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) char addr[22]; #else char addr[12]; @@ -1617,7 +1617,7 @@ dumpit(char* buf, int len) dup = 0; for ( ct=0; ct len; ct++, ptr++, rptr++ ) { if (sw == 0) { -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(addr, %16.16lX,(unsigned long)rptr); #else sprintf(addr, %8.8X,(__u32)rptr); @@ -1632,7 +1632,7 @@ dumpit(char* buf, int len) if (sw == 8) { strcat(bhex, ); } -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(tbuf,%2.2lX, (unsigned long)*ptr); #else sprintf(tbuf,%2.2X, (__u32)*ptr); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/6] s390: minor claw driver fix
Hi , following 6 patches are for s390 network drivers claw, qeth and ctc. tty support will be removed from the ctc network device driver , which will happen with patch 5/6 and 6/6 . The latter one will remove two files , ctctty.c and ctctty.h . Thanks Frank [patch 1/6] s390: minor claw driver fix From: Frank Pavlic [EMAIL PROTECTED] use CONFIG_ARCH_S390X instead of CONFIG_64BIT in function dumpit . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: claw.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index a86436a..4687bb5 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -1601,7 +1601,7 @@ dumpit(char* buf, int len) __u32 ct, sw, rm, dup; char *ptr, *rptr; char tbuf[82], tdup[82]; -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) char addr[22]; #else char addr[12]; @@ -1617,7 +1617,7 @@ dumpit(char* buf, int len) dup = 0; for ( ct=0; ct len; ct++, ptr++, rptr++ ) { if (sw == 0) { -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(addr, %16.16lX,(unsigned long)rptr); #else sprintf(addr, %8.8X,(__u32)rptr); @@ -1632,7 +1632,7 @@ dumpit(char* buf, int len) if (sw == 8) { strcat(bhex, ); } -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(tbuf,%2.2lX, (unsigned long)*ptr); #else sprintf(tbuf,%2.2X, (__u32)*ptr); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 2/6] s390: qeth driver statistics fixes
[patch 2/6] s390: qeth driver statistics fixes From: Ursula Braun [EMAIL PROTECTED] - display unsigned int values in /proc/qeth_perf with %u instead of %i - omit qdio header length when increasing card-stats.tx_bytes Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |3 ++- qeth_proc.c | 38 +++--- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index dba7f7f..634c395 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -4419,6 +4419,7 @@ qeth_send_packet(struct qeth_card *card, int elements_needed = 0; enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; + int tx_bytes = skb-len; int rc; QETH_DBF_TEXT(trace, 6, sendpkt); @@ -4499,7 +4500,7 @@ qeth_send_packet(struct qeth_card *card, elements_needed, ctx); if (!rc){ card-stats.tx_packets++; - card-stats.tx_bytes += skb-len; + card-stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS if (skb_shinfo(skb)-tso_size !(large_send == QETH_LARGE_SEND_NO)) { diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 3c6339d..1304641 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -192,27 +192,27 @@ qeth_perf_procfile_seq_show(struct seq_f CARD_DDEV_ID(card), QETH_CARD_IFNAME(card) ); - seq_printf(s, Skb's/buffers received : %li/%i\n - Skb's/buffers sent : %li/%i\n\n, + seq_printf(s, Skb's/buffers received : %lu/%u\n + Skb's/buffers sent : %lu/%u\n\n, card-stats.rx_packets, card-perf_stats.bufs_rec, card-stats.tx_packets, card-perf_stats.bufs_sent ); - seq_printf(s, Skb's/buffers sent without packing : %li/%i\n - Skb's/buffers sent with packing: %i/%i\n\n, + seq_printf(s, Skb's/buffers sent without packing : %lu/%u\n + Skb's/buffers sent with packing: %u/%u\n\n, card-stats.tx_packets - card-perf_stats.skbs_sent_pack, card-perf_stats.bufs_sent - card-perf_stats.bufs_sent_pack, card-perf_stats.skbs_sent_pack, card-perf_stats.bufs_sent_pack ); - seq_printf(s, Skbs sent in SG mode : %i\n - Skb fragments sent in SG mode : %i\n\n, + seq_printf(s, Skbs sent in SG mode : %u\n + Skb fragments sent in SG mode : %u\n\n, card-perf_stats.sg_skbs_sent, card-perf_stats.sg_frags_sent); - seq_printf(s, large_send tx (in Kbytes) : %i\n - large_send count : %i\n\n, + seq_printf(s, large_send tx (in Kbytes) : %u\n + large_send count : %u\n\n, card-perf_stats.large_send_bytes 10, card-perf_stats.large_send_cnt); - seq_printf(s, Packing state changes no pkg.-packing : %i/%i\n + seq_printf(s, Packing state changes no pkg.-packing : %u/%u\n Watermarks L/H : %i/%i\n Current buffer usage (outbound q's): %i/%i/%i/%i\n\n, @@ -229,16 +229,16 @@ qeth_perf_procfile_seq_show(struct seq_f atomic_read(card-qdio.out_qs[3]-used_buffers) : 0 ); - seq_printf(s, Inbound handler time (in us) : %i\n - Inbound handler count : %i\n - Inbound do_QDIO time (in us) : %i\n - Inbound do_QDIO count : %i\n\n - Outbound handler time (in us) : %i\n - Outbound handler count : %i\n\n - Outbound time (in us, incl QDIO) : %i\n - Outbound count : %i\n - Outbound do_QDIO time (in us) : %i\n - Outbound do_QDIO count : %i\n\n, + seq_printf(s, Inbound handler time (in us) : %u\n + Inbound handler count : %u\n + Inbound do_QDIO time (in us) : %u\n + Inbound do_QDIO count
[patch 6/6] s390: remove tty support from ctc network device driver [2/2]
[patch 6/6] s390: remove tty support from ctc network device driver [2/2] From: Peter Tiedemann [EMAIL PROTECTED] [2/2]: remove ctctty.c and ctctty.h files . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: ctctty.c | 1259 --- ctctty.h | 35 - 2 files changed, 1294 deletions(-) diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c deleted file mode 100644 index 5cdcdbf..000 --- a/drivers/s390/net/ctctty.c +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * CTC / ESCON network driver, tty interface. - * - * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Fritz Elfert ([EMAIL PROTECTED], [EMAIL PROTECTED]) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include linux/config.h -#include linux/module.h -#include linux/tty.h -#include linux/tty_flip.h -#include linux/serial_reg.h -#include linux/interrupt.h -#include linux/delay.h -#include asm/uaccess.h -#include linux/devfs_fs_kernel.h -#include ctctty.h -#include ctcdbug.h - -#define CTC_TTY_MAJOR 43 -#define CTC_TTY_MAX_DEVICES 64 - -#define CTC_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking*/ -#define CTC_ASYNC_INITIALIZED0x8000 /* port was initialized */ -#define CTC_ASYNC_NORMAL_ACTIVE 0x2000 /* Normal device active */ -#define CTC_ASYNC_CLOSING0x0800 /* Serial port is closing */ -#define CTC_ASYNC_CTS_FLOW 0x0400 /* Do CTS flow control */ -#define CTC_ASYNC_CHECK_CD 0x0200 /* i.e., CLOCAL */ -#define CTC_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */ -#define CTC_ASYNC_NETDEV_OPEN0x0002 /* Underlying netdev is open*/ -#define CTC_ASYNC_TX_LINESTAT0x0004 /* Must send line status*/ -#define CTC_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define CTC_TTY_XMIT_SIZE 1024 /* Default bufsize for write*/ -#define CTC_SERIAL_XMIT_MAX4000 /* Maximum bufsize for write*/ - -/* Private data (similar to async_struct in linux/serial.h) */ -typedef struct { - int magic; - int flags; /* defined in tty.h */ - int mcr; /* Modem control register */ - int msr; /* Modem status register */ - int lsr; /* Line status register */ - int line; - int count; /* # of fd on device */ - int blocked_open;/* # of blocked opens */ - struct net_device *netdev; - struct sk_buff_head tx_queue;/* transmit queue */ - struct sk_buff_head rx_queue;/* receive queue */ - struct tty_struct*tty;/* Pointer to corresponding tty */ - wait_queue_head_topen_wait; - wait_queue_head_tclose_wait; - struct semaphore write_sem; - struct tasklet_struct tasklet; - struct timer_list stoptimer; -} ctc_tty_info; - -/* Description of one CTC-tty */ -typedef struct { - struct tty_driver *ctc_tty_device; /* tty-device */ - ctc_tty_info info[CTC_TTY_MAX_DEVICES]; /* Private data */ -} ctc_tty_driver; - -static ctc_tty_driver *driver; - -/* Leave this unchanged unless you know what you do! */ -#define MODEM_PARANOIA_CHECK -#define MODEM_DO_RESTART - -#define CTC_TTY_NAME ctctty - -static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC; -static int ctc_tty_shuttingdown = 0; - -static spinlock_t ctc_tty_lock; - -/* ctc_tty_try_read() is called from within ctc_tty_rcv_skb() - * to stuff incoming data directly into a tty's flip-buffer. If the - * flip buffer is full, the packet gets queued up. - * - * Return: - * 1 = Success - * 0 = Failure, data has to be buffered and later processed by - * ctc_tty_readmodem(). - */ -static int -ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) -{ - int len; - struct tty_struct *tty; - - DBF_TEXT(trace, 5, __FUNCTION__); - if ((tty = info-tty)) { - if (info-mcr UART_MCR_RTS) { - len = skb-len
[patch 1/6] s390: minor claw driver fix
Hi , following 6 patches are for s390 network drivers claw, qeth and ctc. tty support will be removed from the ctc network device driver , which will happen with patch 5/6 and 6/6 . The latter one will remove two files , ctctty.c and ctctty.h . Thanks Frank [patch 1/6] s390: minor claw driver fix From: Frank Pavlic [EMAIL PROTECTED] use CONFIG_ARCH_S390X instead of CONFIG_64BIT in function dumpit . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: claw.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index a86436a..4687bb5 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -1601,7 +1601,7 @@ dumpit(char* buf, int len) __u32 ct, sw, rm, dup; char *ptr, *rptr; char tbuf[82], tdup[82]; -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) char addr[22]; #else char addr[12]; @@ -1617,7 +1617,7 @@ dumpit(char* buf, int len) dup = 0; for ( ct=0; ct len; ct++, ptr++, rptr++ ) { if (sw == 0) { -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(addr, %16.16lX,(unsigned long)rptr); #else sprintf(addr, %8.8X,(__u32)rptr); @@ -1632,7 +1632,7 @@ dumpit(char* buf, int len) if (sw == 8) { strcat(bhex, ); } -#if (CONFIG_64BIT) +#if (CONFIG_ARCH_S390X) sprintf(tbuf,%2.2lX, (unsigned long)*ptr); #else sprintf(tbuf,%2.2X, (__u32)*ptr); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router.
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router. From: Ursula Braun [EMAIL PROTECTED] when setting route6 attribute back to no_router qeth does not issue an IP ASSIST command to reset router value to no_router. Once primary_router is set device stays in this mode. Issue an IP ASSIST command when no_router is set in route6. Device will be reset and thus will not longer run as a primary router. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |5 - 1 files changed, 5 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 69329ea..021cd5d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7339,11 +7339,6 @@ qeth_setrouting_v6(struct qeth_card *car qeth_correct_routing_type(card, card-options.route6.type, QETH_PROT_IPV6); - if ((card-options.route6.type == NO_ROUTER) || - ((card-info.type == QETH_CARD_TYPE_OSAE) -(card-options.route6.type == MULTICAST_ROUTER) -!qeth_is_supported6(card,IPA_OSA_MC_ROUTER))) - return 0; rc = qeth_send_setrouting(card, card-options.route6.type, QETH_PROT_IPV6); if (rc) { - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 3/6] s390: qeth driver cleanups
[patch 3/6] s390: qeth driver cleanups From: Ursula Braun [EMAIL PROTECTED] - code analyzing tool BEAM has found some unreachable and unnecessary statements and also conditions which are always true. - removed some useless MII code since OSA card will never allow to set such values. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 49 - qeth_proc.c | 18 +- qeth_sys.c |2 +- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 634c395..69329ea 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1364,7 +1364,7 @@ qeth_wait_for_buffer(struct qeth_channel static void qeth_clear_cmd_buffers(struct qeth_channel *channel) { - int cnt = 0; + int cnt; for (cnt=0; cnt QETH_CMD_BUFFER_NO; cnt++) qeth_release_buffer(channel,channel-iob[cnt]); @@ -2814,11 +2814,11 @@ qeth_handle_send_error(struct qeth_card QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_LINK_FAILURE; case 3: + default: QETH_DBF_TEXT(trace, 1, SIGAcc3); QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_KICK_IT; } - return QETH_SEND_ERROR_LINK_FAILURE; } void @@ -3865,6 +3865,7 @@ qeth_get_cast_type(struct qeth_card *car if ((hdr_mac == QETH_TR_MAC_NC) || (hdr_mac == QETH_TR_MAC_C)) return RTN_MULTICAST; + break; /* eth or so multicast? */ default: if ((hdr_mac == QETH_ETH_MAC_V4) || @@ -4586,38 +4587,11 @@ qeth_mdio_read(struct net_device *dev, i case MII_NCONFIG: /* network interface config */ break; default: - rc = 0; break; } return rc; } -static void -qeth_mdio_write(struct net_device *dev, int phy_id, int regnum, int value) -{ - switch(regnum){ - case MII_BMCR: /* Basic mode control register */ - case MII_BMSR: /* Basic mode status register */ - case MII_PHYSID1: /* PHYS ID 1 */ - case MII_PHYSID2: /* PHYS ID 2 */ - case MII_ADVERTISE: /* Advertisement control reg */ - case MII_LPA: /* Link partner ability reg */ - case MII_EXPANSION: /* Expansion register */ - case MII_DCOUNTER: /* disconnect counter */ - case MII_FCSCOUNTER: /* false carrier counter */ - case MII_NWAYTEST: /* N-way auto-neg test register */ - case MII_RERRCOUNTER: /* rx error counter */ - case MII_SREVISION: /* silicon revision */ - case MII_RESV1: /* reserved 1 */ - case MII_LBRERROR: /* loopback, rx, bypass error */ - case MII_PHYADDR: /* physical address */ - case MII_RESV2: /* reserved 2 */ - case MII_TPISTATUS: /* TPI status for 10mbps */ - case MII_NCONFIG: /* network interface config */ - default: - break; - } -} static inline const char * qeth_arp_get_error_cause(int *rc) @@ -5237,21 +5211,6 @@ qeth_do_ioctl(struct net_device *dev, st mii_data-val_out = qeth_mdio_read(dev,mii_data-phy_id, mii_data-reg_num); break; - case SIOCSMIIREG: - rc = -EOPNOTSUPP; - break; - /* TODO: remove return if qeth_mdio_write does something */ - if (!capable(CAP_NET_ADMIN)){ - rc = -EPERM; - break; - } - mii_data = if_mii(rq); - if (mii_data-phy_id != 0) - rc = -EINVAL; - else - qeth_mdio_write(dev, mii_data-phy_id, mii_data-reg_num, - mii_data-val_in); - break; default: rc = -EOPNOTSUPP; } @@ -6901,7 +6860,7 @@ qeth_send_setassparms(struct qeth_card * cmd = (struct qeth_ipa_cmd *)(iob-data+IPA_PDU_HEADER_SIZE); if (len = sizeof(__u32)) cmd-data.setassparms.data.flags_32bit = (__u32) data; - else if (len sizeof(__u32)) + else /* (len sizeof(__u32)) */ memcpy(cmd-data.setassparms.data, (void *) data, len); rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 1304641..360d782 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -74,7 +74,7 @@ qeth_procfile_seq_next(struct seq_file * static inline const char * qeth_get_router_str(struct qeth_card *card, int ipv) { - int
[patch 5/6] s390: remove tty support from ctc network device driver [1/2]
[patch 5/6] s390: remove tty support from ctc network device driver [1/2] From: Peter Tiedemann [EMAIL PROTECTED] [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: Makefile |3 ++- ctcmain.c | 45 + ctcmain.h | 12 +--- 3 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile index 90d4d0e..6775a83 100644 --- a/drivers/s390/net/Makefile +++ b/drivers/s390/net/Makefile @@ -2,7 +2,7 @@ # S/390 network devices # -ctc-objs := ctcmain.o ctctty.o ctcdbug.o +ctc-objs := ctcmain.o ctcdbug.o obj-$(CONFIG_IUCV) += iucv.o obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o @@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o +obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o obj-$(CONFIG_QETH) += qeth.o diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212..e2ccaf5 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -6,7 +6,7 @@ * Fixes by : Jochen Röhrig ([EMAIL PROTECTED]) *Arnaldo Carvalho de Melo [EMAIL PROTECTED] Peter Tiedemann ([EMAIL PROTECTED]) - * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] + * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -65,7 +65,6 @@ #include asm/idals.h -#include ctctty.h #include fsm.h #include cu3088.h @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struc skb-dev = pskb-dev; skb-protocol = pskb-protocol; pskb-ip_summed = CHECKSUM_UNNECESSARY; - if (ch-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_ni(skb); /** * Successful rx; reset logflags */ @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsig DBF_TEXT(trace, 5, __FUNCTION__); if (sense SNS0_INTERVENTION_REQ) { if (sense 0x01) { - if (ch-protocol != CTC_PROTO_LINUX_TTY) - ctc_pr_debug(%s: Interface disc. or Sel. reset + ctc_pr_debug(%s: Interface disc. or Sel. reset (remote)\n, ch-id); fsm_event(ch-fsm, CH_EVENT_UC_RCRESET, ch); } else { @@ -2034,7 +2029,6 @@ static void dev_action_chup(fsm_instance * fi, int event, void *arg) { struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int e static void dev_action_chdown(fsm_instance * fi, int event, void *arg) { - struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { case DEV_STATE_RUNNING
[patch 6/6] s390: remove tty support from ctc network device driver [2/2]
[patch 6/6] s390: remove tty support from ctc network device driver [2/2] From: Peter Tiedemann [EMAIL PROTECTED] [2/2]: remove ctctty.c and ctctty.h files . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: ctctty.c | 1259 --- ctctty.h | 35 - 2 files changed, 1294 deletions(-) diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c deleted file mode 100644 index 5cdcdbf..000 --- a/drivers/s390/net/ctctty.c +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * CTC / ESCON network driver, tty interface. - * - * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Fritz Elfert ([EMAIL PROTECTED], [EMAIL PROTECTED]) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include linux/config.h -#include linux/module.h -#include linux/tty.h -#include linux/tty_flip.h -#include linux/serial_reg.h -#include linux/interrupt.h -#include linux/delay.h -#include asm/uaccess.h -#include linux/devfs_fs_kernel.h -#include ctctty.h -#include ctcdbug.h - -#define CTC_TTY_MAJOR 43 -#define CTC_TTY_MAX_DEVICES 64 - -#define CTC_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking*/ -#define CTC_ASYNC_INITIALIZED0x8000 /* port was initialized */ -#define CTC_ASYNC_NORMAL_ACTIVE 0x2000 /* Normal device active */ -#define CTC_ASYNC_CLOSING0x0800 /* Serial port is closing */ -#define CTC_ASYNC_CTS_FLOW 0x0400 /* Do CTS flow control */ -#define CTC_ASYNC_CHECK_CD 0x0200 /* i.e., CLOCAL */ -#define CTC_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */ -#define CTC_ASYNC_NETDEV_OPEN0x0002 /* Underlying netdev is open*/ -#define CTC_ASYNC_TX_LINESTAT0x0004 /* Must send line status*/ -#define CTC_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define CTC_TTY_XMIT_SIZE 1024 /* Default bufsize for write*/ -#define CTC_SERIAL_XMIT_MAX4000 /* Maximum bufsize for write*/ - -/* Private data (similar to async_struct in linux/serial.h) */ -typedef struct { - int magic; - int flags; /* defined in tty.h */ - int mcr; /* Modem control register */ - int msr; /* Modem status register */ - int lsr; /* Line status register */ - int line; - int count; /* # of fd on device */ - int blocked_open;/* # of blocked opens */ - struct net_device *netdev; - struct sk_buff_head tx_queue;/* transmit queue */ - struct sk_buff_head rx_queue;/* receive queue */ - struct tty_struct*tty;/* Pointer to corresponding tty */ - wait_queue_head_topen_wait; - wait_queue_head_tclose_wait; - struct semaphore write_sem; - struct tasklet_struct tasklet; - struct timer_list stoptimer; -} ctc_tty_info; - -/* Description of one CTC-tty */ -typedef struct { - struct tty_driver *ctc_tty_device; /* tty-device */ - ctc_tty_info info[CTC_TTY_MAX_DEVICES]; /* Private data */ -} ctc_tty_driver; - -static ctc_tty_driver *driver; - -/* Leave this unchanged unless you know what you do! */ -#define MODEM_PARANOIA_CHECK -#define MODEM_DO_RESTART - -#define CTC_TTY_NAME ctctty - -static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC; -static int ctc_tty_shuttingdown = 0; - -static spinlock_t ctc_tty_lock; - -/* ctc_tty_try_read() is called from within ctc_tty_rcv_skb() - * to stuff incoming data directly into a tty's flip-buffer. If the - * flip buffer is full, the packet gets queued up. - * - * Return: - * 1 = Success - * 0 = Failure, data has to be buffered and later processed by - * ctc_tty_readmodem(). - */ -static int -ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) -{ - int len; - struct tty_struct *tty; - - DBF_TEXT(trace, 5, __FUNCTION__); - if ((tty = info-tty)) { - if (info-mcr UART_MCR_RTS) { - len = skb-len
[patch 3/6] s390: qeth driver cleanups
[patch 3/6] s390: qeth driver cleanups From: Ursula Braun [EMAIL PROTECTED] - code analyzing tool BEAM has found some unreachable and unnecessary statements and also conditions which are always true. - removed some useless MII code since OSA card will never allow to set such values. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 49 - qeth_proc.c | 18 +- qeth_sys.c |2 +- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 634c395..69329ea 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1364,7 +1364,7 @@ qeth_wait_for_buffer(struct qeth_channel static void qeth_clear_cmd_buffers(struct qeth_channel *channel) { - int cnt = 0; + int cnt; for (cnt=0; cnt QETH_CMD_BUFFER_NO; cnt++) qeth_release_buffer(channel,channel-iob[cnt]); @@ -2814,11 +2814,11 @@ qeth_handle_send_error(struct qeth_card QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_LINK_FAILURE; case 3: + default: QETH_DBF_TEXT(trace, 1, SIGAcc3); QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_KICK_IT; } - return QETH_SEND_ERROR_LINK_FAILURE; } void @@ -3865,6 +3865,7 @@ qeth_get_cast_type(struct qeth_card *car if ((hdr_mac == QETH_TR_MAC_NC) || (hdr_mac == QETH_TR_MAC_C)) return RTN_MULTICAST; + break; /* eth or so multicast? */ default: if ((hdr_mac == QETH_ETH_MAC_V4) || @@ -4586,38 +4587,11 @@ qeth_mdio_read(struct net_device *dev, i case MII_NCONFIG: /* network interface config */ break; default: - rc = 0; break; } return rc; } -static void -qeth_mdio_write(struct net_device *dev, int phy_id, int regnum, int value) -{ - switch(regnum){ - case MII_BMCR: /* Basic mode control register */ - case MII_BMSR: /* Basic mode status register */ - case MII_PHYSID1: /* PHYS ID 1 */ - case MII_PHYSID2: /* PHYS ID 2 */ - case MII_ADVERTISE: /* Advertisement control reg */ - case MII_LPA: /* Link partner ability reg */ - case MII_EXPANSION: /* Expansion register */ - case MII_DCOUNTER: /* disconnect counter */ - case MII_FCSCOUNTER: /* false carrier counter */ - case MII_NWAYTEST: /* N-way auto-neg test register */ - case MII_RERRCOUNTER: /* rx error counter */ - case MII_SREVISION: /* silicon revision */ - case MII_RESV1: /* reserved 1 */ - case MII_LBRERROR: /* loopback, rx, bypass error */ - case MII_PHYADDR: /* physical address */ - case MII_RESV2: /* reserved 2 */ - case MII_TPISTATUS: /* TPI status for 10mbps */ - case MII_NCONFIG: /* network interface config */ - default: - break; - } -} static inline const char * qeth_arp_get_error_cause(int *rc) @@ -5237,21 +5211,6 @@ qeth_do_ioctl(struct net_device *dev, st mii_data-val_out = qeth_mdio_read(dev,mii_data-phy_id, mii_data-reg_num); break; - case SIOCSMIIREG: - rc = -EOPNOTSUPP; - break; - /* TODO: remove return if qeth_mdio_write does something */ - if (!capable(CAP_NET_ADMIN)){ - rc = -EPERM; - break; - } - mii_data = if_mii(rq); - if (mii_data-phy_id != 0) - rc = -EINVAL; - else - qeth_mdio_write(dev, mii_data-phy_id, mii_data-reg_num, - mii_data-val_in); - break; default: rc = -EOPNOTSUPP; } @@ -6901,7 +6860,7 @@ qeth_send_setassparms(struct qeth_card * cmd = (struct qeth_ipa_cmd *)(iob-data+IPA_PDU_HEADER_SIZE); if (len = sizeof(__u32)) cmd-data.setassparms.data.flags_32bit = (__u32) data; - else if (len sizeof(__u32)) + else /* (len sizeof(__u32)) */ memcpy(cmd-data.setassparms.data, (void *) data, len); rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 1304641..360d782 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -74,7 +74,7 @@ qeth_procfile_seq_next(struct seq_file * static inline const char * qeth_get_router_str(struct qeth_card *card, int ipv) { - int
[patch 5/6] s390: remove tty support from ctc network device driver [1/2]
[patch 5/6] s390: remove tty support from ctc network device driver [1/2] From: Peter Tiedemann [EMAIL PROTECTED] [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: Makefile |3 ++- ctcmain.c | 45 + ctcmain.h | 12 +--- 3 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile index 90d4d0e..6775a83 100644 --- a/drivers/s390/net/Makefile +++ b/drivers/s390/net/Makefile @@ -2,7 +2,7 @@ # S/390 network devices # -ctc-objs := ctcmain.o ctctty.o ctcdbug.o +ctc-objs := ctcmain.o ctcdbug.o obj-$(CONFIG_IUCV) += iucv.o obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o @@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o +obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o obj-$(CONFIG_QETH) += qeth.o diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212..e2ccaf5 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -6,7 +6,7 @@ * Fixes by : Jochen Röhrig ([EMAIL PROTECTED]) *Arnaldo Carvalho de Melo [EMAIL PROTECTED] Peter Tiedemann ([EMAIL PROTECTED]) - * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] + * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -65,7 +65,6 @@ #include asm/idals.h -#include ctctty.h #include fsm.h #include cu3088.h @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struc skb-dev = pskb-dev; skb-protocol = pskb-protocol; pskb-ip_summed = CHECKSUM_UNNECESSARY; - if (ch-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_ni(skb); /** * Successful rx; reset logflags */ @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsig DBF_TEXT(trace, 5, __FUNCTION__); if (sense SNS0_INTERVENTION_REQ) { if (sense 0x01) { - if (ch-protocol != CTC_PROTO_LINUX_TTY) - ctc_pr_debug(%s: Interface disc. or Sel. reset + ctc_pr_debug(%s: Interface disc. or Sel. reset (remote)\n, ch-id); fsm_event(ch-fsm, CH_EVENT_UC_RCRESET, ch); } else { @@ -2034,7 +2029,6 @@ static void dev_action_chup(fsm_instance * fi, int event, void *arg) { struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int e static void dev_action_chdown(fsm_instance * fi, int event, void *arg) { - struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { case DEV_STATE_RUNNING
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router.
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router. From: Ursula Braun [EMAIL PROTECTED] when setting route6 attribute back to no_router qeth does not issue an IP ASSIST command to reset router value to no_router. Once primary_router is set device stays in this mode. Issue an IP ASSIST command when no_router is set in route6. Device will be reset and thus will not longer run as a primary router. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |5 - 1 files changed, 5 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 69329ea..021cd5d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7339,11 +7339,6 @@ qeth_setrouting_v6(struct qeth_card *car qeth_correct_routing_type(card, card-options.route6.type, QETH_PROT_IPV6); - if ((card-options.route6.type == NO_ROUTER) || - ((card-info.type == QETH_CARD_TYPE_OSAE) -(card-options.route6.type == MULTICAST_ROUTER) -!qeth_is_supported6(card,IPA_OSA_MC_ROUTER))) - return 0; rc = qeth_send_setrouting(card, card-options.route6.type, QETH_PROT_IPV6); if (rc) { - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 6/6] s390: remove tty support from ctc network device driver [2/2]
[patch 6/6] s390: remove tty support from ctc network device driver [2/2] From: Peter Tiedemann [EMAIL PROTECTED] [2/2]: remove ctctty.c and ctctty.h files . Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: ctctty.c | 1259 --- ctctty.h | 35 - 2 files changed, 1294 deletions(-) diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c deleted file mode 100644 index 5cdcdbf..000 --- a/drivers/s390/net/ctctty.c +++ /dev/null @@ -1,1259 +0,0 @@ -/* - * CTC / ESCON network driver, tty interface. - * - * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation - * Author(s): Fritz Elfert ([EMAIL PROTECTED], [EMAIL PROTECTED]) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include linux/config.h -#include linux/module.h -#include linux/tty.h -#include linux/tty_flip.h -#include linux/serial_reg.h -#include linux/interrupt.h -#include linux/delay.h -#include asm/uaccess.h -#include linux/devfs_fs_kernel.h -#include ctctty.h -#include ctcdbug.h - -#define CTC_TTY_MAJOR 43 -#define CTC_TTY_MAX_DEVICES 64 - -#define CTC_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking*/ -#define CTC_ASYNC_INITIALIZED0x8000 /* port was initialized */ -#define CTC_ASYNC_NORMAL_ACTIVE 0x2000 /* Normal device active */ -#define CTC_ASYNC_CLOSING0x0800 /* Serial port is closing */ -#define CTC_ASYNC_CTS_FLOW 0x0400 /* Do CTS flow control */ -#define CTC_ASYNC_CHECK_CD 0x0200 /* i.e., CLOCAL */ -#define CTC_ASYNC_HUP_NOTIFY 0x0001 /* Notify tty on hangups/closes */ -#define CTC_ASYNC_NETDEV_OPEN0x0002 /* Underlying netdev is open*/ -#define CTC_ASYNC_TX_LINESTAT0x0004 /* Must send line status*/ -#define CTC_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define CTC_TTY_XMIT_SIZE 1024 /* Default bufsize for write*/ -#define CTC_SERIAL_XMIT_MAX4000 /* Maximum bufsize for write*/ - -/* Private data (similar to async_struct in linux/serial.h) */ -typedef struct { - int magic; - int flags; /* defined in tty.h */ - int mcr; /* Modem control register */ - int msr; /* Modem status register */ - int lsr; /* Line status register */ - int line; - int count; /* # of fd on device */ - int blocked_open;/* # of blocked opens */ - struct net_device *netdev; - struct sk_buff_head tx_queue;/* transmit queue */ - struct sk_buff_head rx_queue;/* receive queue */ - struct tty_struct*tty;/* Pointer to corresponding tty */ - wait_queue_head_topen_wait; - wait_queue_head_tclose_wait; - struct semaphore write_sem; - struct tasklet_struct tasklet; - struct timer_list stoptimer; -} ctc_tty_info; - -/* Description of one CTC-tty */ -typedef struct { - struct tty_driver *ctc_tty_device; /* tty-device */ - ctc_tty_info info[CTC_TTY_MAX_DEVICES]; /* Private data */ -} ctc_tty_driver; - -static ctc_tty_driver *driver; - -/* Leave this unchanged unless you know what you do! */ -#define MODEM_PARANOIA_CHECK -#define MODEM_DO_RESTART - -#define CTC_TTY_NAME ctctty - -static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC; -static int ctc_tty_shuttingdown = 0; - -static spinlock_t ctc_tty_lock; - -/* ctc_tty_try_read() is called from within ctc_tty_rcv_skb() - * to stuff incoming data directly into a tty's flip-buffer. If the - * flip buffer is full, the packet gets queued up. - * - * Return: - * 1 = Success - * 0 = Failure, data has to be buffered and later processed by - * ctc_tty_readmodem(). - */ -static int -ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) -{ - int len; - struct tty_struct *tty; - - DBF_TEXT(trace, 5, __FUNCTION__); - if ((tty = info-tty)) { - if (info-mcr UART_MCR_RTS) { - len = skb-len
[patch 5/6] s390: remove tty support from ctc network device driver [1/2]
[patch 5/6] s390: remove tty support from ctc network device driver [1/2] From: Peter Tiedemann [EMAIL PROTECTED] [1/2]: tty support code will be removed from the ctc network device driver. Today we have a couple of alternatives which are performing much better. The second thing is that ctc should be a network device driver only. We should not mix tty and networking here. This first patch will remove the tty code from ctcmain.c . It also removes the build entry from the Makefile as well as TTY definitions from ctcmain.h. The second patch will remove two files, ctctty.c and ctctty.h. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: Makefile |3 ++- ctcmain.c | 45 + ctcmain.h | 12 +--- 3 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile index 90d4d0e..6775a83 100644 --- a/drivers/s390/net/Makefile +++ b/drivers/s390/net/Makefile @@ -2,7 +2,7 @@ # S/390 network devices # -ctc-objs := ctcmain.o ctctty.o ctcdbug.o +ctc-objs := ctcmain.o ctcdbug.o obj-$(CONFIG_IUCV) += iucv.o obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o @@ -10,6 +10,7 @@ obj-$(CONFIG_SMSGIUCV) += smsgiucv.o obj-$(CONFIG_CTC) += ctc.o fsm.o cu3088.o obj-$(CONFIG_LCS) += lcs.o cu3088.o obj-$(CONFIG_CLAW) += claw.o cu3088.o +obj-$(CONFIG_MPC) += ctcmpc.o fsm.o cu3088.o qeth-y := qeth_main.o qeth_mpc.o qeth_sys.o qeth_eddp.o qeth-$(CONFIG_PROC_FS) += qeth_proc.o obj-$(CONFIG_QETH) += qeth.o diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212..e2ccaf5 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c @@ -6,7 +6,7 @@ * Fixes by : Jochen Röhrig ([EMAIL PROTECTED]) *Arnaldo Carvalho de Melo [EMAIL PROTECTED] Peter Tiedemann ([EMAIL PROTECTED]) - * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] + * Driver Model stuff by : Cornelia Huck [EMAIL PROTECTED] * * Documentation used: * - Principles of Operation (IBM doc#: SA22-7201-06) @@ -65,7 +65,6 @@ #include asm/idals.h -#include ctctty.h #include fsm.h #include cu3088.h @@ -479,10 +478,7 @@ ctc_unpack_skb(struct channel *ch, struc skb-dev = pskb-dev; skb-protocol = pskb-protocol; pskb-ip_summed = CHECKSUM_UNNECESSARY; - if (ch-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_netif_rx(skb); - else - netif_rx_ni(skb); + netif_rx_ni(skb); /** * Successful rx; reset logflags */ @@ -557,8 +553,7 @@ ccw_unit_check(struct channel *ch, unsig DBF_TEXT(trace, 5, __FUNCTION__); if (sense SNS0_INTERVENTION_REQ) { if (sense 0x01) { - if (ch-protocol != CTC_PROTO_LINUX_TTY) - ctc_pr_debug(%s: Interface disc. or Sel. reset + ctc_pr_debug(%s: Interface disc. or Sel. reset (remote)\n, ch-id); fsm_event(ch-fsm, CH_EVENT_UC_RCRESET, ch); } else { @@ -2034,7 +2029,6 @@ static void dev_action_chup(fsm_instance * fi, int event, void *arg) { struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { @@ -2049,8 +2043,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2059,8 +2051,6 @@ dev_action_chup(fsm_instance * fi, int e fsm_newstate(fi, DEV_STATE_RUNNING); ctc_pr_info(%s: connected with remote side\n, dev-name); - if (privptr-protocol == CTC_PROTO_LINUX_TTY) - ctc_tty_setcarrier(dev, 1); ctc_clear_busy(dev); } break; @@ -2086,14 +2076,10 @@ dev_action_chup(fsm_instance * fi, int e static void dev_action_chdown(fsm_instance * fi, int event, void *arg) { - struct net_device *dev = (struct net_device *) arg; - struct ctc_priv *privptr = dev-priv; DBF_TEXT(trace, 3, __FUNCTION__); switch (fsm_getstate(fi)) { case DEV_STATE_RUNNING
[patch 3/6] s390: qeth driver cleanups
[patch 3/6] s390: qeth driver cleanups From: Ursula Braun [EMAIL PROTECTED] - code analyzing tool BEAM has found some unreachable and unnecessary statements and also conditions which are always true. - removed some useless MII code since OSA card will never allow to set such values. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 49 - qeth_proc.c | 18 +- qeth_sys.c |2 +- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 634c395..69329ea 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -1364,7 +1364,7 @@ qeth_wait_for_buffer(struct qeth_channel static void qeth_clear_cmd_buffers(struct qeth_channel *channel) { - int cnt = 0; + int cnt; for (cnt=0; cnt QETH_CMD_BUFFER_NO; cnt++) qeth_release_buffer(channel,channel-iob[cnt]); @@ -2814,11 +2814,11 @@ qeth_handle_send_error(struct qeth_card QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_LINK_FAILURE; case 3: + default: QETH_DBF_TEXT(trace, 1, SIGAcc3); QETH_DBF_TEXT_(trace,1,%s,CARD_BUS_ID(card)); return QETH_SEND_ERROR_KICK_IT; } - return QETH_SEND_ERROR_LINK_FAILURE; } void @@ -3865,6 +3865,7 @@ qeth_get_cast_type(struct qeth_card *car if ((hdr_mac == QETH_TR_MAC_NC) || (hdr_mac == QETH_TR_MAC_C)) return RTN_MULTICAST; + break; /* eth or so multicast? */ default: if ((hdr_mac == QETH_ETH_MAC_V4) || @@ -4586,38 +4587,11 @@ qeth_mdio_read(struct net_device *dev, i case MII_NCONFIG: /* network interface config */ break; default: - rc = 0; break; } return rc; } -static void -qeth_mdio_write(struct net_device *dev, int phy_id, int regnum, int value) -{ - switch(regnum){ - case MII_BMCR: /* Basic mode control register */ - case MII_BMSR: /* Basic mode status register */ - case MII_PHYSID1: /* PHYS ID 1 */ - case MII_PHYSID2: /* PHYS ID 2 */ - case MII_ADVERTISE: /* Advertisement control reg */ - case MII_LPA: /* Link partner ability reg */ - case MII_EXPANSION: /* Expansion register */ - case MII_DCOUNTER: /* disconnect counter */ - case MII_FCSCOUNTER: /* false carrier counter */ - case MII_NWAYTEST: /* N-way auto-neg test register */ - case MII_RERRCOUNTER: /* rx error counter */ - case MII_SREVISION: /* silicon revision */ - case MII_RESV1: /* reserved 1 */ - case MII_LBRERROR: /* loopback, rx, bypass error */ - case MII_PHYADDR: /* physical address */ - case MII_RESV2: /* reserved 2 */ - case MII_TPISTATUS: /* TPI status for 10mbps */ - case MII_NCONFIG: /* network interface config */ - default: - break; - } -} static inline const char * qeth_arp_get_error_cause(int *rc) @@ -5237,21 +5211,6 @@ qeth_do_ioctl(struct net_device *dev, st mii_data-val_out = qeth_mdio_read(dev,mii_data-phy_id, mii_data-reg_num); break; - case SIOCSMIIREG: - rc = -EOPNOTSUPP; - break; - /* TODO: remove return if qeth_mdio_write does something */ - if (!capable(CAP_NET_ADMIN)){ - rc = -EPERM; - break; - } - mii_data = if_mii(rq); - if (mii_data-phy_id != 0) - rc = -EINVAL; - else - qeth_mdio_write(dev, mii_data-phy_id, mii_data-reg_num, - mii_data-val_in); - break; default: rc = -EOPNOTSUPP; } @@ -6901,7 +6860,7 @@ qeth_send_setassparms(struct qeth_card * cmd = (struct qeth_ipa_cmd *)(iob-data+IPA_PDU_HEADER_SIZE); if (len = sizeof(__u32)) cmd-data.setassparms.data.flags_32bit = (__u32) data; - else if (len sizeof(__u32)) + else /* (len sizeof(__u32)) */ memcpy(cmd-data.setassparms.data, (void *) data, len); rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 1304641..360d782 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -74,7 +74,7 @@ qeth_procfile_seq_next(struct seq_file * static inline const char * qeth_get_router_str(struct qeth_card *card, int ipv) { - int
[patch 2/6] s390: qeth driver statistics fixes
[patch 2/6] s390: qeth driver statistics fixes From: Ursula Braun [EMAIL PROTECTED] - display unsigned int values in /proc/qeth_perf with %u instead of %i - omit qdio header length when increasing card-stats.tx_bytes Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |3 ++- qeth_proc.c | 38 +++--- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index dba7f7f..634c395 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -4419,6 +4419,7 @@ qeth_send_packet(struct qeth_card *card, int elements_needed = 0; enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; + int tx_bytes = skb-len; int rc; QETH_DBF_TEXT(trace, 6, sendpkt); @@ -4499,7 +4500,7 @@ qeth_send_packet(struct qeth_card *card, elements_needed, ctx); if (!rc){ card-stats.tx_packets++; - card-stats.tx_bytes += skb-len; + card-stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS if (skb_shinfo(skb)-tso_size !(large_send == QETH_LARGE_SEND_NO)) { diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 3c6339d..1304641 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -192,27 +192,27 @@ qeth_perf_procfile_seq_show(struct seq_f CARD_DDEV_ID(card), QETH_CARD_IFNAME(card) ); - seq_printf(s, Skb's/buffers received : %li/%i\n - Skb's/buffers sent : %li/%i\n\n, + seq_printf(s, Skb's/buffers received : %lu/%u\n + Skb's/buffers sent : %lu/%u\n\n, card-stats.rx_packets, card-perf_stats.bufs_rec, card-stats.tx_packets, card-perf_stats.bufs_sent ); - seq_printf(s, Skb's/buffers sent without packing : %li/%i\n - Skb's/buffers sent with packing: %i/%i\n\n, + seq_printf(s, Skb's/buffers sent without packing : %lu/%u\n + Skb's/buffers sent with packing: %u/%u\n\n, card-stats.tx_packets - card-perf_stats.skbs_sent_pack, card-perf_stats.bufs_sent - card-perf_stats.bufs_sent_pack, card-perf_stats.skbs_sent_pack, card-perf_stats.bufs_sent_pack ); - seq_printf(s, Skbs sent in SG mode : %i\n - Skb fragments sent in SG mode : %i\n\n, + seq_printf(s, Skbs sent in SG mode : %u\n + Skb fragments sent in SG mode : %u\n\n, card-perf_stats.sg_skbs_sent, card-perf_stats.sg_frags_sent); - seq_printf(s, large_send tx (in Kbytes) : %i\n - large_send count : %i\n\n, + seq_printf(s, large_send tx (in Kbytes) : %u\n + large_send count : %u\n\n, card-perf_stats.large_send_bytes 10, card-perf_stats.large_send_cnt); - seq_printf(s, Packing state changes no pkg.-packing : %i/%i\n + seq_printf(s, Packing state changes no pkg.-packing : %u/%u\n Watermarks L/H : %i/%i\n Current buffer usage (outbound q's): %i/%i/%i/%i\n\n, @@ -229,16 +229,16 @@ qeth_perf_procfile_seq_show(struct seq_f atomic_read(card-qdio.out_qs[3]-used_buffers) : 0 ); - seq_printf(s, Inbound handler time (in us) : %i\n - Inbound handler count : %i\n - Inbound do_QDIO time (in us) : %i\n - Inbound do_QDIO count : %i\n\n - Outbound handler time (in us) : %i\n - Outbound handler count : %i\n\n - Outbound time (in us, incl QDIO) : %i\n - Outbound count : %i\n - Outbound do_QDIO time (in us) : %i\n - Outbound do_QDIO count : %i\n\n, + seq_printf(s, Inbound handler time (in us) : %u\n + Inbound handler count : %u\n + Inbound do_QDIO time (in us) : %u\n + Inbound do_QDIO count
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router.
[patch 4/6] s390: qeth :allow setting of attribute route6 to no_router. From: Ursula Braun [EMAIL PROTECTED] when setting route6 attribute back to no_router qeth does not issue an IP ASSIST command to reset router value to no_router. Once primary_router is set device stays in this mode. Issue an IP ASSIST command when no_router is set in route6. Device will be reset and thus will not longer run as a primary router. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |5 - 1 files changed, 5 deletions(-) diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 69329ea..021cd5d 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -7339,11 +7339,6 @@ qeth_setrouting_v6(struct qeth_card *car qeth_correct_routing_type(card, card-options.route6.type, QETH_PROT_IPV6); - if ((card-options.route6.type == NO_ROUTER) || - ((card-info.type == QETH_CARD_TYPE_OSAE) -(card-options.route6.type == MULTICAST_ROUTER) -!qeth_is_supported6(card,IPA_OSA_MC_ROUTER))) - return 0; rc = qeth_send_setrouting(card, card-options.route6.type, QETH_PROT_IPV6); if (rc) { - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/2] s390: lcs performance enhancements
[patch 1/2] s390: lcs performance enhancements From: Klaus Wacker [EMAIL PROTECTED] - When flood pinging (with large packet size) an LCS device, about 90 % of all packets are dropped by driver. - increased number of lcs IO buffers to 32. - use netif_stop_queue/netif_wake_queue in lcs_start_xmit routine - don't lock the whole xmit routine but just the piece of code where tx_buffer is touched. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: lcs.c | 31 +-- lcs.h |2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff -Naupr git-orig/drivers/s390/net/lcs.c git-patched/drivers/s390/net/lcs.c --- git-orig/drivers/s390/net/lcs.c 2006-02-07 10:55:28.0 +0100 +++ git-patched/drivers/s390/net/lcs.c 2006-02-07 11:06:37.0 +0100 @@ -98,9 +98,9 @@ lcs_register_debug_facility(void) return -ENOMEM; } debug_register_view(lcs_dbf_setup, debug_hex_ascii_view); - debug_set_level(lcs_dbf_setup, 4); + debug_set_level(lcs_dbf_setup, 2); debug_register_view(lcs_dbf_trace, debug_hex_ascii_view); - debug_set_level(lcs_dbf_trace, 4); + debug_set_level(lcs_dbf_trace, 2); return 0; } @@ -1292,9 +1292,8 @@ lcs_set_multicast_list(struct net_device LCS_DBF_TEXT(4, trace, setmulti); card = (struct lcs_card *) dev-priv; -if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) { +if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) schedule_work(card-kernel_thread_starter); - } } #endif /* CONFIG_IP_MULTICAST */ @@ -1459,6 +1458,8 @@ lcs_txbuffer_cb(struct lcs_channel *chan lcs_release_buffer(channel, buffer); card = (struct lcs_card *) ((char *) channel - offsetof(struct lcs_card, write)); + if (netif_queue_stopped(card-dev)) + netif_wake_queue(card-dev); spin_lock(card-lock); card-tx_emitted--; if (card-tx_emitted = 0 card-tx_buffer != NULL) @@ -1478,6 +1479,7 @@ __lcs_start_xmit(struct lcs_card *card, struct net_device *dev) { struct lcs_header *header; + int rc = 0; LCS_DBF_TEXT(5, trace, hardxmit); if (skb == NULL) { @@ -1492,10 +1494,8 @@ __lcs_start_xmit(struct lcs_card *card, card-stats.tx_carrier_errors++; return 0; } - if (netif_queue_stopped(dev) ) { - card-stats.tx_dropped++; - return -EBUSY; - } + netif_stop_queue(card-dev); + spin_lock(card-lock); if (card-tx_buffer != NULL card-tx_buffer-count + sizeof(struct lcs_header) + skb-len + sizeof(u16) LCS_IOBUFFERSIZE) @@ -1506,7 +1506,8 @@ __lcs_start_xmit(struct lcs_card *card, card-tx_buffer = lcs_get_buffer(card-write); if (card-tx_buffer == NULL) { card-stats.tx_dropped++; - return -EBUSY; + rc = -EBUSY; + goto out; } card-tx_buffer-callback = lcs_txbuffer_cb; card-tx_buffer-count = 0; @@ -1518,13 +1519,18 @@ __lcs_start_xmit(struct lcs_card *card, header-type = card-lan_type; header-slot = card-portno; memcpy(header + 1, skb-data, skb-len); + spin_unlock(card-lock); card-stats.tx_bytes += skb-len; card-stats.tx_packets++; dev_kfree_skb(skb); - if (card-tx_emitted = 0) + netif_wake_queue(card-dev); + spin_lock(card-lock); + if (card-tx_emitted = 0 card-tx_buffer != NULL) /* If this is the first tx buffer emit it immediately. */ __lcs_emit_txbuffer(card); - return 0; +out: + spin_unlock(card-lock); + return rc; } static int @@ -1535,9 +1541,7 @@ lcs_start_xmit(struct sk_buff *skb, stru LCS_DBF_TEXT(5, trace, pktxmit); card = (struct lcs_card *) dev-priv; - spin_lock(card-lock); rc = __lcs_start_xmit(card, skb, dev); - spin_unlock(card-lock); return rc; } @@ -2319,7 +2323,6 @@ __init lcs_init_module(void) PRINT_ERR(Initialization failed\n); return rc; } - return 0; } diff -Naupr git-orig/drivers/s390/net/lcs.h git-patched/drivers/s390/net/lcs.h --- git-orig/drivers/s390/net/lcs.h 2006-02-07 10:55:28.0 +0100 +++ git-patched/drivers/s390/net/lcs.h 2006-02-07 11:00:08.0 +0100 @@ -95,7 +95,7 @@ do { */ #define LCS_ILLEGAL_OFFSET 0x #define LCS_IOBUFFERSIZE 0x5000 -#define LCS_NUM_BUFFS 8 /* needs to be power of 2 */ +#define LCS_NUM_BUFFS 32 /* needs to be power of 2 */ #define LCS_MAC_LENGTH 6 #define
[patch 2/2] s390: some qeth driver fixes
[patch 2/2] s390: some qeth driver fixes From: Frank Pavlic [EMAIL PROTECTED] - fixed kernel panic when using EDDP support in Layer 2 mode - NULL pointer exception in qeth_set_offline fixed. - setting EDDP in Layer 2 mode did not set NETIF_F_(SG/TSO) flags when device became online. - use sscanf for parsing and converting IPv4 addresses from string to __u8 values. - qeth_string_to_ipaddr6 fixed. in case of double colon the converted IPv6 address out from the string was not correct in previous implementation. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth.h | 112 +--- qeth_eddp.c | 11 - qeth_main.c | 17 +++-- 3 files changed, 63 insertions(+), 77 deletions(-) diff -Naupr git-orig/drivers/s390/net/qeth_eddp.c git-patched/drivers/s390/net/qeth_eddp.c --- git-orig/drivers/s390/net/qeth_eddp.c 2006-02-07 10:55:28.0 +0100 +++ git-patched/drivers/s390/net/qeth_eddp.c2006-02-07 11:17:11.0 +0100 @@ -59,8 +59,7 @@ qeth_eddp_free_context(struct qeth_eddp_ for (i = 0; i ctx-num_pages; ++i) free_page((unsigned long)ctx-pages[i]); kfree(ctx-pages); - if (ctx-elements != NULL) - kfree(ctx-elements); + kfree(ctx-elements); kfree(ctx); } @@ -413,6 +412,13 @@ __qeth_eddp_fill_context_tcp(struct qeth QETH_DBF_TEXT(trace, 5, eddpftcp); eddp-skb_offset = sizeof(struct qeth_hdr) + eddp-nhl + eddp-thl; + if (eddp-qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { + eddp-skb_offset += sizeof(struct ethhdr); +#ifdef CONFIG_QETH_VLAN + if (eddp-mac.h_proto == __constant_htons(ETH_P_8021Q)) + eddp-skb_offset += VLAN_HLEN; +#endif /* CONFIG_QETH_VLAN */ + } tcph = eddp-skb-h.th; while (eddp-skb_offset eddp-skb-len) { data_len = min((int)skb_shinfo(eddp-skb)-tso_size, @@ -483,6 +489,7 @@ qeth_eddp_fill_context_tcp(struct qeth_e return -ENOMEM; } if (qhdr-hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { + skb-mac.raw = (skb-data) + sizeof(struct qeth_hdr); memcpy(eddp-mac, eth_hdr(skb), ETH_HLEN); #ifdef CONFIG_QETH_VLAN if (eddp-mac.h_proto == __constant_htons(ETH_P_8021Q)) { diff -Naupr git-orig/drivers/s390/net/qeth.h git-patched/drivers/s390/net/qeth.h --- git-orig/drivers/s390/net/qeth.h2006-02-07 10:55:28.0 +0100 +++ git-patched/drivers/s390/net/qeth.h 2006-02-07 11:17:11.0 +0100 @@ -1076,16 +1076,6 @@ qeth_get_qdio_q_format(struct qeth_card } static inline int -qeth_isdigit(char * buf) -{ - while (*buf) { - if (!isdigit(*buf++)) - return 0; - } - return 1; -} - -static inline int qeth_isxdigit(char * buf) { while (*buf) { @@ -1104,33 +1094,17 @@ qeth_ipaddr4_to_string(const __u8 *addr, static inline int qeth_string_to_ipaddr4(const char *buf, __u8 *addr) { - const char *start, *end; - char abuf[4]; - char *tmp; - int len; - int i; - - start = buf; - for (i = 0; i 4; i++) { - if (i == 3) { - end = strchr(start,0xa); - if (end) - len = end - start; - else - len = strlen(start); - } - else { - end = strchr(start, '.'); - len = end - start; - } - if ((len = 0) || (len 3)) - return -EINVAL; - memset(abuf, 0, 4); - strncpy(abuf, start, len); - if (!qeth_isdigit(abuf)) + int count = 0, rc = 0; + int in[4]; + + rc = sscanf(buf, %d.%d.%d.%d%n, + in[0], in[1], in[2], in[3], count); + if (rc != 4 || count) + return -EINVAL; + for (count = 0; count 4; count++) { + if (in[count] 255) return -EINVAL; - addr[i] = simple_strtoul(abuf, tmp, 10); - start = end + 1; + addr[count] = in[count]; } return 0; } @@ -1149,36 +1123,44 @@ qeth_ipaddr6_to_string(const __u8 *addr, static inline int qeth_string_to_ipaddr6(const char *buf, __u8 *addr) { - const char *start, *end; - u16 *tmp_addr; - char abuf[5]; - char *tmp; - int len; - int i; - - tmp_addr = (u16 *)addr; - start = buf; - for (i = 0; i 8; i++) { - if (i == 7) { - end = strchr(start,0xa); - if (end) - len = end - start; - else - len
[RESEND patch 1/3] s390: some minor qeth driver fixes
Hi Jeff, I am not sure if my first try did make his way since I had some fights with my exim4 configuration. Anyway I resend the patches . Thanks Frank [patch 1/3] s390: some minor qeth driver fixes From: Frank Pavlic [EMAIL PROTECTED] - let's have just one function for both ,input and output queue to check qdio errors - add /proc/s390dbf/qeth_qerr entries for outbound processing - check removed for layer2 device in qeth_add_multicast_ipv6 - NULL pointer dereference with bonding and VLAN device fixed - minimum length check for portname fixed Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 42 +- qeth_sys.c |6 +++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- linux-orig/drivers/s390/net/qeth_main.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-12-12 17:46:31.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.242 $ +#define VERSION_QETH_C $Revision: 1.246 $ static const char *version = qeth S/390 OSA-Express driver; /** @@ -2203,24 +2203,21 @@ qeth_ulp_setup(struct qeth_card *card) } static inline int -qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, -unsigned int qdio_error, -unsigned int siga_error) +qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, + unsigned int siga_error, const char *dbftext) { - int rc = 0; - if (qdio_error || siga_error) { - QETH_DBF_TEXT(trace, 2, qdinerr); - QETH_DBF_TEXT(qerr, 2, qdinerr); + QETH_DBF_TEXT(trace, 2, dbftext); + QETH_DBF_TEXT(qerr, 2, dbftext); QETH_DBF_TEXT_(qerr, 2, F15=%02X, - buf-buffer-element[15].flags 0xff); + buf-element[15].flags 0xff); QETH_DBF_TEXT_(qerr, 2, F14=%02X, - buf-buffer-element[14].flags 0xff); + buf-element[14].flags 0xff); QETH_DBF_TEXT_(qerr, 2, qerr=%X, qdio_error); QETH_DBF_TEXT_(qerr, 2, serr=%X, siga_error); - rc = 1; + return 1; } - return rc; + return 0; } static inline struct sk_buff * @@ -2769,8 +2766,9 @@ qeth_qdio_input_handler(struct ccw_devic for (i = first_element; i (first_element + count); ++i) { index = i % QDIO_MAX_BUFFERS_PER_Q; buffer = card-qdio.in_q-bufs[index]; - if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) - qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) + if (!((status QDIO_STATUS_LOOK_FOR_ERROR) + qeth_check_qdio_errors(buffer-buffer, +qdio_err, siga_err,qinerr))) qeth_process_inbound_buffer(card, buffer, index); /* clear buffer and give back to hardware */ qeth_put_buffer_pool_entry(card, buffer-pool_entry); @@ -2785,12 +2783,13 @@ qeth_qdio_input_handler(struct ccw_devic static inline int qeth_handle_send_error(struct qeth_card *card, struct qeth_qdio_out_buffer *buffer, - int qdio_err, int siga_err) + unsigned int qdio_err, unsigned int siga_err) { int sbalf15 = buffer-buffer-element[15].flags 0xff; int cc = siga_err 3; QETH_DBF_TEXT(trace, 6, hdsnderr); + qeth_check_qdio_errors(buffer-buffer, qdio_err, siga_err, qouterr); switch (cc) { case 0: if (qdio_err){ @@ -3047,7 +3046,8 @@ qeth_qdio_output_handler(struct ccw_devi for(i = first_element; i (first_element + count); ++i){ buffer = queue-bufs[i % QDIO_MAX_BUFFERS_PER_Q]; /*we only handle the KICK_IT error by doing a recovery */ - if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) + if (qeth_handle_send_error(card, buffer, + qdio_error, siga_error) == QETH_SEND_ERROR_KICK_IT){ netif_stop_queue(card-dev); qeth_schedule_recovery(card); @@ -3289,7 +3289,6 @@ qeth_init_qdio_info(struct qeth_card *ca card-qdio.in_buf_pool.buf_count = card-qdio.init_pool.buf_count; INIT_LIST_HEAD(card-qdio.in_buf_pool.entry_list
[RESEND patch 3/3] s390: remove redundant and useless code in qeth
[patch 3/3] s390: remove redundant and useless code in qeth From: Frank Pavlic [EMAIL PROTECTED] - remove redundant and useless code in qeth for procfs operations. - update Revision numbers Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |6 - qeth_mpc.c |2 qeth_mpc.h |2 qeth_proc.c | 250 ++-- qeth_sys.c |4 qeth_tso.h |4 6 files changed, 38 insertions(+), 230 deletions(-) diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- linux-orig/drivers/s390/net/qeth_main.c 2005-12-12 19:01:34.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-12-12 19:13:30.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -12,7 +12,7 @@ * Frank Pavlic ([EMAIL PROTECTED]) and * Thomas Spatzier [EMAIL PROTECTED] * - *$Revision: 1.242 $$Date: 2005/05/04 20:19:18 $ + *$Revision: 1.251 $$Date: 2005/05/04 20:19:18 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.246 $ +#define VERSION_QETH_C $Revision: 1.251 $ static const char *version = qeth S/390 OSA-Express driver; /** diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.c linux-patched/drivers/s390/net/qeth_mpc.c --- linux-orig/drivers/s390/net/qeth_mpc.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.c 2005-12-12 19:13:41.0 +0100 @@ -11,7 +11,7 @@ #include asm/cio.h #include qeth_mpc.h -const char *VERSION_QETH_MPC_C = $Revision: 1.12 $; +const char *VERSION_QETH_MPC_C = $Revision: 1.13 $; unsigned char IDX_ACTIVATE_READ[]={ 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00, diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h --- linux-orig/drivers/s390/net/qeth_mpc.h 2005-12-12 19:01:34.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.h 2005-12-12 19:13:54.0 +0100 @@ -14,7 +14,7 @@ #include asm/qeth.h -#define VERSION_QETH_MPC_H $Revision: 1.44 $ +#define VERSION_QETH_MPC_H $Revision: 1.46 $ extern const char *VERSION_QETH_MPC_C; diff -Naupr linux-orig/drivers/s390/net/qeth_proc.c linux-patched/drivers/s390/net/qeth_proc.c --- linux-orig/drivers/s390/net/qeth_proc.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_proc.c 2005-12-12 19:03:53.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) + * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) * * 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.13 $; +const char *VERSION_QETH_PROC_C = $Revision: 1.16 $; /* /proc/qeth */ #define QETH_PROCFILE_NAME qeth @@ -30,30 +30,26 @@ static struct proc_dir_entry *qeth_procf static int qeth_procfile_seq_match(struct device *dev, void *data) { - return 1; + return(dev ? 1 : 0); } static void * qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) { - struct device *dev; - loff_t nr; - + struct device *dev = NULL; + loff_t nr = 0; + down_read(qeth_ccwgroup_driver.driver.bus-subsys.rwsem); - - nr = *offset; - if (nr == 0) + if (*offset == 0) return SEQ_START_TOKEN; - - dev = driver_find_device(qeth_ccwgroup_driver.driver, NULL, -NULL, qeth_procfile_seq_match); - - /* get card at pos *offset */ - nr = *offset; - while (nr-- 1 dev) + while (1) { dev = driver_find_device(qeth_ccwgroup_driver.driver, dev, NULL, qeth_procfile_seq_match); - return (void *) dev; + if (++nr == *offset) + break; + put_device(dev); + } + return dev; } static void @@ -66,19 +62,14 @@ static void * qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) { struct device *prev, *next; - - if (it == SEQ_START_TOKEN) { - next = driver_find_device(qeth_ccwgroup_driver.driver, - NULL, NULL, qeth_procfile_seq_match); - if (next) - (*offset)++; - return (void *) next; - } - prev = (struct device *) it; + + if (it == SEQ_START_TOKEN
Re: [patch 3/3] s390: remove redundant and useless code in qeth
On Tue, 13 Dec 2005 18:59:30 +0100 Christian Borntraeger [EMAIL PROTECTED] wrote: On Tuesday 13 December 2005 18:47, Stephen Hemminger wrote: Is there any chance of removing usage of netif_rx_reschedule()? qeth seems to be the only remaining user of this interface. Huh? I guess you are talking about the ibmveth driver for the POWER boxes? qeth (for zSeries and z9 boxes) currently does not use NAPI and therefore it does not use netif_rx_reschedule. yes, you are talking about ibm veth driver... fgrep -r netif_rx_reschedule drivers/* drivers/net/ibmveth.c: if(ibmveth_rxq_pending_buffer(adapter) netif_rx_reschedule(netdev, frames_processed)) Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/3] s390: some minor qeth driver fixes
[patch 1/3] s390: some minor qeth driver fixes From: Frank Pavlic [EMAIL PROTECTED] - let's have just one function for both ,input and output queue to check qdio errors - add /proc/s390dbf/qeth_qerr entries for outbound processing - check removed for layer2 device in qeth_add_multicast_ipv6 - NULL pointer dereference with bonding and VLAN device fixed - minimum length check for portname fixed Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 42 +- qeth_sys.c |6 +++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- linux-orig/drivers/s390/net/qeth_main.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-12-12 17:46:31.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.242 $ +#define VERSION_QETH_C $Revision: 1.246 $ static const char *version = qeth S/390 OSA-Express driver; /** @@ -2203,24 +2203,21 @@ qeth_ulp_setup(struct qeth_card *card) } static inline int -qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, -unsigned int qdio_error, -unsigned int siga_error) +qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, + unsigned int siga_error, const char *dbftext) { - int rc = 0; - if (qdio_error || siga_error) { - QETH_DBF_TEXT(trace, 2, qdinerr); - QETH_DBF_TEXT(qerr, 2, qdinerr); + QETH_DBF_TEXT(trace, 2, dbftext); + QETH_DBF_TEXT(qerr, 2, dbftext); QETH_DBF_TEXT_(qerr, 2, F15=%02X, - buf-buffer-element[15].flags 0xff); + buf-element[15].flags 0xff); QETH_DBF_TEXT_(qerr, 2, F14=%02X, - buf-buffer-element[14].flags 0xff); + buf-element[14].flags 0xff); QETH_DBF_TEXT_(qerr, 2, qerr=%X, qdio_error); QETH_DBF_TEXT_(qerr, 2, serr=%X, siga_error); - rc = 1; + return 1; } - return rc; + return 0; } static inline struct sk_buff * @@ -2769,8 +2766,9 @@ qeth_qdio_input_handler(struct ccw_devic for (i = first_element; i (first_element + count); ++i) { index = i % QDIO_MAX_BUFFERS_PER_Q; buffer = card-qdio.in_q-bufs[index]; - if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) - qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) + if (!((status QDIO_STATUS_LOOK_FOR_ERROR) + qeth_check_qdio_errors(buffer-buffer, +qdio_err, siga_err,qinerr))) qeth_process_inbound_buffer(card, buffer, index); /* clear buffer and give back to hardware */ qeth_put_buffer_pool_entry(card, buffer-pool_entry); @@ -2785,12 +2783,13 @@ qeth_qdio_input_handler(struct ccw_devic static inline int qeth_handle_send_error(struct qeth_card *card, struct qeth_qdio_out_buffer *buffer, - int qdio_err, int siga_err) + unsigned int qdio_err, unsigned int siga_err) { int sbalf15 = buffer-buffer-element[15].flags 0xff; int cc = siga_err 3; QETH_DBF_TEXT(trace, 6, hdsnderr); + qeth_check_qdio_errors(buffer-buffer, qdio_err, siga_err, qouterr); switch (cc) { case 0: if (qdio_err){ @@ -3047,7 +3046,8 @@ qeth_qdio_output_handler(struct ccw_devi for(i = first_element; i (first_element + count); ++i){ buffer = queue-bufs[i % QDIO_MAX_BUFFERS_PER_Q]; /*we only handle the KICK_IT error by doing a recovery */ - if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) + if (qeth_handle_send_error(card, buffer, + qdio_error, siga_error) == QETH_SEND_ERROR_KICK_IT){ netif_stop_queue(card-dev); qeth_schedule_recovery(card); @@ -3289,7 +3289,6 @@ qeth_init_qdio_info(struct qeth_card *ca card-qdio.in_buf_pool.buf_count = card-qdio.init_pool.buf_count; INIT_LIST_HEAD(card-qdio.in_buf_pool.entry_list); INIT_LIST_HEAD(card-qdio.init_pool.entry_list); - /* outbound */ } static int @@ -3731,6 +3730,9 @@ qeth_verify_vlan_dev(struct net_device
[patch 3/3] s390: remove redundant and useless code in qeth
[patch 3/3] s390: remove redundant and useless code in qeth From: Frank Pavlic [EMAIL PROTECTED] - remove redundant and useless code in qeth for procfs operations. - update Revision numbers Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c |6 - qeth_mpc.c |2 qeth_mpc.h |2 qeth_proc.c | 250 ++-- qeth_sys.c |4 qeth_tso.h |4 6 files changed, 38 insertions(+), 230 deletions(-) diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- linux-orig/drivers/s390/net/qeth_main.c 2005-12-12 19:01:34.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-12-12 19:13:30.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -12,7 +12,7 @@ * Frank Pavlic ([EMAIL PROTECTED]) and * Thomas Spatzier [EMAIL PROTECTED] * - *$Revision: 1.242 $$Date: 2005/05/04 20:19:18 $ + *$Revision: 1.251 $$Date: 2005/05/04 20:19:18 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.246 $ +#define VERSION_QETH_C $Revision: 1.251 $ static const char *version = qeth S/390 OSA-Express driver; /** diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.c linux-patched/drivers/s390/net/qeth_mpc.c --- linux-orig/drivers/s390/net/qeth_mpc.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.c 2005-12-12 19:13:41.0 +0100 @@ -11,7 +11,7 @@ #include asm/cio.h #include qeth_mpc.h -const char *VERSION_QETH_MPC_C = $Revision: 1.12 $; +const char *VERSION_QETH_MPC_C = $Revision: 1.13 $; unsigned char IDX_ACTIVATE_READ[]={ 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00, diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h --- linux-orig/drivers/s390/net/qeth_mpc.h 2005-12-12 19:01:34.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.h 2005-12-12 19:13:54.0 +0100 @@ -14,7 +14,7 @@ #include asm/qeth.h -#define VERSION_QETH_MPC_H $Revision: 1.44 $ +#define VERSION_QETH_MPC_H $Revision: 1.46 $ extern const char *VERSION_QETH_MPC_C; diff -Naupr linux-orig/drivers/s390/net/qeth_proc.c linux-patched/drivers/s390/net/qeth_proc.c --- linux-orig/drivers/s390/net/qeth_proc.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_proc.c 2005-12-12 19:03:53.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) + * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) * * 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.13 $; +const char *VERSION_QETH_PROC_C = $Revision: 1.16 $; /* /proc/qeth */ #define QETH_PROCFILE_NAME qeth @@ -30,30 +30,26 @@ static struct proc_dir_entry *qeth_procf static int qeth_procfile_seq_match(struct device *dev, void *data) { - return 1; + return(dev ? 1 : 0); } static void * qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) { - struct device *dev; - loff_t nr; - + struct device *dev = NULL; + loff_t nr = 0; + down_read(qeth_ccwgroup_driver.driver.bus-subsys.rwsem); - - nr = *offset; - if (nr == 0) + if (*offset == 0) return SEQ_START_TOKEN; - - dev = driver_find_device(qeth_ccwgroup_driver.driver, NULL, -NULL, qeth_procfile_seq_match); - - /* get card at pos *offset */ - nr = *offset; - while (nr-- 1 dev) + while (1) { dev = driver_find_device(qeth_ccwgroup_driver.driver, dev, NULL, qeth_procfile_seq_match); - return (void *) dev; + if (++nr == *offset) + break; + put_device(dev); + } + return dev; } static void @@ -66,19 +62,14 @@ static void * qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) { struct device *prev, *next; - - if (it == SEQ_START_TOKEN) { - next = driver_find_device(qeth_ccwgroup_driver.driver, - NULL, NULL, qeth_procfile_seq_match); - if (next) - (*offset)++; - return (void *) next; - } - prev = (struct device *) it; + + if (it == SEQ_START_TOKEN
[patch 2/3] s390: minor qeth network driver fixes
[patch 2/3] s390: minor qeth network driver fixes From: Frank Pavlic [EMAIL PROTECTED] - use netif_carrier_on/off calls to tell network stack link carrier state - fix possible kfree on NULL - PDU_LEN2 is at offset 0x29 otherwise OSN chpid won't initialize Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_eddp.c |3 ++- qeth_main.c | 17 +++-- qeth_mpc.h |2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff -Naupr linux-orig/drivers/s390/net/qeth_eddp.c linux-patched/drivers/s390/net/qeth_eddp.c --- linux-orig/drivers/s390/net/qeth_eddp.c 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_eddp.c 2005-12-12 18:56:23.0 +0100 @@ -62,7 +62,8 @@ qeth_eddp_free_context(struct qeth_eddp_ for (i = 0; i ctx-num_pages; ++i) free_page((unsigned long)ctx-pages[i]); kfree(ctx-pages); - kfree(ctx-elements); + if (ctx-elements != NULL) + kfree(ctx-elements); kfree(ctx); } diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- linux-orig/drivers/s390/net/qeth_main.c 2005-12-12 18:15:36.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-12-12 18:56:23.0 +0100 @@ -518,7 +518,8 @@ __qeth_set_offline(struct ccwgroup_devic QETH_DBF_TEXT(setup, 3, setoffl); QETH_DBF_HEX(setup, 3, card, sizeof(void *)); - + + netif_carrier_off(card-dev); recover_flag = card-state; if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ PRINT_WARN(Stopping card %s interrupted by user!\n, @@ -1020,7 +1021,6 @@ void qeth_schedule_recovery(struct qeth_card *card) { QETH_DBF_TEXT(trace,2,startrec); - if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) schedule_work(card-kernel_thread_starter); } @@ -1710,7 +1710,6 @@ qeth_check_ipa_data(struct qeth_card *ca IP address reset.\n, QETH_CARD_IFNAME(card), card-info.chpid); - netif_carrier_on(card-dev); qeth_schedule_recovery(card); return NULL; case IPA_CMD_MODCCID: @@ -1959,7 +1958,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card * { u16 s1, s2; -QETH_DBF_TEXT(trace,4,osndipa); + QETH_DBF_TEXT(trace,4,osndipa); qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); @@ -3809,10 +3808,8 @@ qeth_open(struct net_device *dev) card-data.state = CH_STATE_UP; card-state = CARD_STATE_UP; - if (!card-lan_online){ - if (netif_carrier_ok(dev)) - netif_carrier_off(dev); - } + if (!card-lan_online netif_carrier_ok(dev)) + netif_carrier_off(dev); return 0; } @@ -7936,8 +7933,8 @@ __qeth_set_online(struct ccwgroup_device QETH_DBF_TEXT_(setup, 2, 6err%d, rc); goto out_remove; } -/*maybe it was set offline without ifconfig down - * we can also use this state for recovery purposes*/ + netif_carrier_on(card-dev); + qeth_set_allowed_threads(card, 0x, 0); if (recover_flag == CARD_STATE_RECOVER) qeth_start_again(card, recovery_mode); diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h --- linux-orig/drivers/s390/net/qeth_mpc.h 2005-12-12 17:33:48.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.h 2005-12-12 18:56:23.0 +0100 @@ -21,7 +21,7 @@ extern const char *VERSION_QETH_MPC_C; #define IPA_PDU_HEADER_SIZE0x40 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) -#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a) +#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29) #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) extern unsigned char IPA_PDU_HEADER[]; - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [patch 1/7] s390: synthax checking for VIPA addresses fixed
Jeff Garzik wrote: Frank Pavlic wrote: [patch 1/7] s390: synthax checking for VIPA addresses fixed From: Peter Tiedemann [EMAIL PROTECTED] - synthax checking for VIPA addresses fixed Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth.h | 65 - qeth_sys.c |6 ++--- 2 files changed, 55 insertions(+), 16 deletions(-) diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h --- orig/drivers/s390/net/qeth.h2005-11-09 20:06:57.0 +0100 +++ patched-linux/drivers/s390/net/qeth.h2005-11-09 20:11:20.0 +0100 @@ -8,6 +8,7 @@ #include linux/trdevice.h #include linux/etherdevice.h #include linux/if_vlan.h +#include linux/ctype.h #include net/ipv6.h #include linux/in6.h @@ -24,7 +25,7 @@ #include qeth_mpc.h -#define VERSION_QETH_H $Revision: 1.142 $ +#define VERSION_QETH_H $Revision: 1.151 $ #ifdef CONFIG_QETH_IPV6 #define QETH_VERSION_IPV6 :IPv6 @@ -1074,6 +1075,26 @@ qeth_get_qdio_q_format(struct qeth_card } } +static inline int +qeth_isdigit(char * buf) +{ +while (*buf) { +if (!isdigit(*buf++)) +return 0; +} +return 1; +} + +static inline int +qeth_isxdigit(char * buf) +{ +while (*buf) { +if (!isxdigit(*buf++)) +return 0; +} +return 1; +} + static inline void qeth_ipaddr4_to_string(const __u8 *addr, char *buf) { @@ -1090,18 +,27 @@ qeth_string_to_ipaddr4(const char *buf, int i; start = buf; -for (i = 0; i 3; i++) { -if (!(end = strchr(start, '.'))) +for (i = 0; i 4; i++) { +if (i == 3) { +end = strchr(start,0xa); +if (end) +len = end - start; +else +len = strlen(start); +} +else { +end = strchr(start, '.'); +len = end - start; +} +if ((len = 0) || (len 3)) return -EINVAL; -len = end - start; memset(abuf, 0, 4); strncpy(abuf, start, len); +if (!qeth_isdigit(abuf)) +return -EINVAL; addr[i] = simple_strtoul(abuf, tmp, 10); start = end + 1; } -memset(abuf, 0, 4); -strcpy(abuf, start); -addr[3] = simple_strtoul(abuf, tmp, 10); return 0; } @@ -1128,18 +1158,27 @@ qeth_string_to_ipaddr6(const char *buf, tmp_addr = (u16 *)addr; start = buf; -for (i = 0; i 7; i++) { -if (!(end = strchr(start, ':'))) +for (i = 0; i 8; i++) { +if (i == 7) { +end = strchr(start,0xa); +if (end) +len = end - start; +else +len = strlen(start); +} +else { +end = strchr(start, ':'); +len = end - start; +} +if ((len = 0) || (len 4)) return -EINVAL; -len = end - start; memset(abuf, 0, 5); strncpy(abuf, start, len); +if (!qeth_isxdigit(abuf)) +return -EINVAL; tmp_addr[i] = simple_strtoul(abuf, tmp, 16); start = end + 1; OK for now, but please submit a patch that updates this code to use sscanf(). Jeff Hi, I agree with you , this needs to be reworked .. Thanks ... Frank - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 4/7] s390: some more qeth fixes
[patch 4/7] s390: some more qeth fixes From: Frank Pavlic [EMAIL PROTECTED] From: Peter Tiedemann [EMAIL PROTECTED] - possible race on list fixed by reset list processing after every operation - traffic hang fixed Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth_main.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c --- orig/drivers/s390/net/qeth_main.c 2005-11-09 20:37:03.0 +0100 +++ patched-linux/drivers/s390/net/qeth_main.c 2005-11-09 20:38:23.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.236 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.238 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -12,7 +12,7 @@ * Frank Pavlic ([EMAIL PROTECTED]) and * Thomas Spatzier [EMAIL PROTECTED] * - *$Revision: 1.236 $$Date: 2005/05/04 20:19:18 $ + *$Revision: 1.238 $$Date: 2005/05/04 20:19:18 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.236 $ +#define VERSION_QETH_C $Revision: 1.238 $ static const char *version = qeth S/390 OSA-Express driver; /** @@ -799,7 +799,7 @@ __qeth_delete_all_mc(struct qeth_card *c { struct qeth_ipaddr *addr, *tmp; int rc; - +again: list_for_each_entry_safe(addr, tmp, card-ip_list, entry) { if (addr-is_multicast) { spin_unlock_irqrestore(card-ip_lock, *flags); @@ -808,6 +808,7 @@ __qeth_delete_all_mc(struct qeth_card *c if (!rc) { list_del(addr-entry); kfree(addr); + goto again; } } } @@ -4336,6 +4337,8 @@ qeth_do_send_packet(struct qeth_card *ca out: if (flush_count) qeth_flush_buffers(queue, 0, start_index, flush_count); + else if (!atomic_read(queue-set_pci_flags_count)) + atomic_swap(queue-state, QETH_OUT_Q_LOCKED_FLUSH); /* * queue-state will go from LOCKED - UNLOCKED or from * LOCKED_FLUSH - LOCKED if output_handler wanted to 'notify' us - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 6/7] s390: introduce guestLan sniffer support in qeth
[patch 6/7] s390: introduce guestLan sniffer support in qeth From: Peter Tiedemann [EMAIL PROTECTED] - introduce guestLan sniffer support in qeth feature allows a linux in a virtual machine guest to become a network LAN sniffer, monitoring and recording the networking traffic within an entire guestLan. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth.h |2 + qeth_main.c | 93 qeth_mpc.h | 11 --- 3 files changed, 102 insertions(+), 4 deletions(-) diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h --- orig/drivers/s390/net/qeth.h2005-11-09 20:49:36.0 +0100 +++ patched-linux/drivers/s390/net/qeth.h 2005-11-09 20:52:27.0 +0100 @@ -750,6 +750,7 @@ struct qeth_card_info { int unique_id; struct qeth_card_blkt blkt; __u32 csum_mask; + enum qeth_ipa_promisc_modes promisc_mode; }; struct qeth_card_options { @@ -776,6 +777,7 @@ struct qeth_card_options { enum qeth_threads { QETH_SET_IP_THREAD = 1, QETH_RECOVER_THREAD = 2, + QETH_SET_PROMISC_MODE_THREAD = 4, }; struct qeth_osn_info { diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c --- orig/drivers/s390/net/qeth_main.c 2005-11-09 20:49:36.0 +0100 +++ patched-linux/drivers/s390/net/qeth_main.c 2005-11-09 20:50:03.0 +0100 @@ -160,6 +160,9 @@ static void qeth_set_multicast_list(struct net_device *); static void +qeth_setadp_promisc_mode(struct qeth_card *); + +static void qeth_notify_processes(void) { /*notify all registered processes */ @@ -965,6 +968,24 @@ qeth_register_ip_addresses(void *ptr) return 0; } +/* + * Drive the SET_PROMISC_MODE thread + */ +static int +qeth_set_promisc_mode(void *ptr) +{ + struct qeth_card *card = (struct qeth_card *) ptr; + + daemonize(qeth_setprm); + QETH_DBF_TEXT(trace,4,setprm1); + if (!qeth_do_run_thread(card, QETH_SET_PROMISC_MODE_THREAD)) + return 0; + QETH_DBF_TEXT(trace,4,setprm2); + qeth_setadp_promisc_mode(card); + qeth_clear_thread_running_bit(card, QETH_SET_PROMISC_MODE_THREAD); + return 0; +} + static int qeth_recover(void *ptr) { @@ -1031,6 +1052,8 @@ qeth_start_kernel_thread(struct qeth_car if (qeth_do_start_thread(card, QETH_SET_IP_THREAD)) kernel_thread(qeth_register_ip_addresses, (void *)card,SIGCHLD); + if (qeth_do_start_thread(card, QETH_SET_PROMISC_MODE_THREAD)) + kernel_thread(qeth_set_promisc_mode, (void *)card, SIGCHLD); if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) kernel_thread(qeth_recover, (void *) card, SIGCHLD); } @@ -5003,6 +5026,10 @@ qeth_default_setassparms_cb(struct qeth_ unsigned long); static int +qeth_default_setadapterparms_cb(struct qeth_card *card, +struct qeth_reply *reply, +unsigned long data); +static int qeth_send_setassparms(struct qeth_card *, struct qeth_cmd_buffer *, __u16, long, int (*reply_cb) @@ -5476,6 +5503,59 @@ qeth_vlan_rx_kill_vid(struct net_device qeth_set_multicast_list(card-dev); } #endif +/** + * Examine hardware response to SET_PROMISC_MODE + */ +static int +qeth_setadp_promisc_mode_cb(struct qeth_card *card, + struct qeth_reply *reply, + unsigned long data) +{ + struct qeth_ipa_cmd *cmd; + struct qeth_ipacmd_setadpparms *setparms; + + QETH_DBF_TEXT(trace,4,prmadpcb); + + cmd = (struct qeth_ipa_cmd *) data; + setparms = (cmd-data.setadapterparms); + +qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); + if (cmd-hdr.return_code) { + QETH_DBF_TEXT_(trace,4,prmrc%2.2x,cmd-hdr.return_code); + setparms-data.mode = SET_PROMISC_MODE_OFF; + } + card-info.promisc_mode = setparms-data.mode; + return 0; +} +/* + * Set promiscuous mode (on or off) (SET_PROMISC_MODE command) + */ +static void +qeth_setadp_promisc_mode(struct qeth_card *card) +{ + enum qeth_ipa_promisc_modes mode; + struct net_device *dev = card-dev; + struct qeth_cmd_buffer *iob; + struct qeth_ipa_cmd *cmd; + + QETH_DBF_TEXT(trace, 4, setprom); + + if (((dev-flags IFF_PROMISC) +(card-info.promisc_mode == SET_PROMISC_MODE_ON)) || + (!(dev-flags IFF_PROMISC) +(card-info.promisc_mode == SET_PROMISC_MODE_OFF))) + return; + mode = SET_PROMISC_MODE_OFF; + if (dev-flags IFF_PROMISC) + mode = SET_PROMISC_MODE_ON; + QETH_DBF_TEXT_(trace, 4, mode:%x, mode); + + iob = qeth_get_adapter_cmd(card
[patch 7/7] s390: mail address changed
[patch 7/7] s390: mail address changed From: Frank Pavlic [EMAIL PROTECTED] - mail address changed to [EMAIL PROTECTED] Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: lcs.c |4 ++-- qeth_main.c |4 ++-- qeth_mpc.c |2 +- qeth_mpc.h |2 +- qeth_sys.c |2 +- qeth_tso.h |2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff -Naupr orig/drivers/s390/net/lcs.c linux-patched/drivers/s390/net/lcs.c --- orig/drivers/s390/net/lcs.c 2005-11-10 13:11:18.0 +0100 +++ linux-patched/drivers/s390/net/lcs.c2005-11-10 13:07:11.0 +0100 @@ -8,7 +8,7 @@ *Author(s): Original Code written by * DJ Barrow ([EMAIL PROTECTED],[EMAIL PROTECTED]) * Rewritten by - * Frank Pavlic ([EMAIL PROTECTED]) and + * Frank Pavlic ([EMAIL PROTECTED]) and * Martin Schwidefsky [EMAIL PROTECTED] * *$Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $ @@ -2342,6 +2342,6 @@ __exit lcs_cleanup_module(void) module_init(lcs_init_module); module_exit(lcs_cleanup_module); -MODULE_AUTHOR(Frank Pavlic [EMAIL PROTECTED]); +MODULE_AUTHOR(Frank Pavlic [EMAIL PROTECTED]); MODULE_LICENSE(GPL); diff -Naupr orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c --- orig/drivers/s390/net/qeth_main.c 2005-11-10 13:13:21.0 +0100 +++ linux-patched/drivers/s390/net/qeth_main.c 2005-11-10 13:07:56.0 +0100 @@ -9,7 +9,7 @@ *Author(s): Original Code written by * Utz Bacher ([EMAIL PROTECTED]) * Rewritten by - * Frank Pavlic ([EMAIL PROTECTED]) and + * Frank Pavlic ([EMAIL PROTECTED]) and * Thomas Spatzier [EMAIL PROTECTED] * *$Revision: 1.242 $$Date: 2005/05/04 20:19:18 $ @@ -8715,7 +8715,7 @@ EXPORT_SYMBOL(qeth_osn_deregister); EXPORT_SYMBOL(qeth_osn_assist); module_init(qeth_init); module_exit(qeth_exit); -MODULE_AUTHOR(Frank Pavlic [EMAIL PROTECTED]); +MODULE_AUTHOR(Frank Pavlic [EMAIL PROTECTED]); MODULE_DESCRIPTION(Linux on zSeries OSA Express and HiperSockets support\n \ Copyright 2000,2003 IBM Corporation\n); diff -Naupr orig/drivers/s390/net/qeth_mpc.c linux-patched/drivers/s390/net/qeth_mpc.c --- orig/drivers/s390/net/qeth_mpc.c2005-11-10 13:11:18.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.c 2005-11-10 13:08:05.0 +0100 @@ -4,7 +4,7 @@ * Linux on zSeries OSA Express and HiperSockets support * * Copyright 2000,2003 IBM Corporation - * Author(s): Frank Pavlic [EMAIL PROTECTED] + * Author(s): Frank Pavlic [EMAIL PROTECTED] * Thomas Spatzier [EMAIL PROTECTED] * */ diff -Naupr orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h --- orig/drivers/s390/net/qeth_mpc.h2005-11-10 13:13:21.0 +0100 +++ linux-patched/drivers/s390/net/qeth_mpc.h 2005-11-10 13:08:19.0 +0100 @@ -6,7 +6,7 @@ * Copyright 2000,2003 IBM Corporation * Author(s): Utz Bacher [EMAIL PROTECTED] *Thomas Spatzier [EMAIL PROTECTED] - *Frank Pavlic [EMAIL PROTECTED] + *Frank Pavlic [EMAIL PROTECTED] * */ #ifndef __QETH_MPC_H__ diff -Naupr orig/drivers/s390/net/qeth_sys.c linux-patched/drivers/s390/net/qeth_sys.c --- orig/drivers/s390/net/qeth_sys.c2005-11-10 13:12:52.0 +0100 +++ linux-patched/drivers/s390/net/qeth_sys.c 2005-11-10 13:08:30.0 +0100 @@ -8,7 +8,7 @@ * Copyright 2000,2003 IBM Corporation * * Author(s): Thomas Spatzier [EMAIL PROTECTED] - * Frank Pavlic [EMAIL PROTECTED] + * Frank Pavlic [EMAIL PROTECTED] * */ #include linux/list.h diff -Naupr orig/drivers/s390/net/qeth_tso.h linux-patched/drivers/s390/net/qeth_tso.h --- orig/drivers/s390/net/qeth_tso.h2005-11-10 13:11:18.0 +0100 +++ linux-patched/drivers/s390/net/qeth_tso.h 2005-11-10 13:08:43.0 +0100 @@ -5,7 +5,7 @@ * * Copyright 2004 IBM Corporation * - *Author(s): Frank Pavlic [EMAIL PROTECTED] + *Author(s): Frank Pavlic [EMAIL PROTECTED] * *$Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ * - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[patch 1/7] s390: synthax checking for VIPA addresses fixed
[patch 1/7] s390: synthax checking for VIPA addresses fixed From: Peter Tiedemann [EMAIL PROTECTED] - synthax checking for VIPA addresses fixed Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth.h | 65 - qeth_sys.c |6 ++--- 2 files changed, 55 insertions(+), 16 deletions(-) diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h --- orig/drivers/s390/net/qeth.h2005-11-09 20:06:57.0 +0100 +++ patched-linux/drivers/s390/net/qeth.h 2005-11-09 20:11:20.0 +0100 @@ -8,6 +8,7 @@ #include linux/trdevice.h #include linux/etherdevice.h #include linux/if_vlan.h +#include linux/ctype.h #include net/ipv6.h #include linux/in6.h @@ -24,7 +25,7 @@ #include qeth_mpc.h -#define VERSION_QETH_H $Revision: 1.142 $ +#define VERSION_QETH_H $Revision: 1.151 $ #ifdef CONFIG_QETH_IPV6 #define QETH_VERSION_IPV6 :IPv6 @@ -1074,6 +1075,26 @@ qeth_get_qdio_q_format(struct qeth_card } } +static inline int +qeth_isdigit(char * buf) +{ + while (*buf) { + if (!isdigit(*buf++)) + return 0; + } + return 1; +} + +static inline int +qeth_isxdigit(char * buf) +{ + while (*buf) { + if (!isxdigit(*buf++)) + return 0; + } + return 1; +} + static inline void qeth_ipaddr4_to_string(const __u8 *addr, char *buf) { @@ -1090,18 +,27 @@ qeth_string_to_ipaddr4(const char *buf, int i; start = buf; - for (i = 0; i 3; i++) { - if (!(end = strchr(start, '.'))) + for (i = 0; i 4; i++) { + if (i == 3) { + end = strchr(start,0xa); + if (end) + len = end - start; + else + len = strlen(start); + } + else { + end = strchr(start, '.'); + len = end - start; + } + if ((len = 0) || (len 3)) return -EINVAL; - len = end - start; memset(abuf, 0, 4); strncpy(abuf, start, len); + if (!qeth_isdigit(abuf)) + return -EINVAL; addr[i] = simple_strtoul(abuf, tmp, 10); start = end + 1; } - memset(abuf, 0, 4); - strcpy(abuf, start); - addr[3] = simple_strtoul(abuf, tmp, 10); return 0; } @@ -1128,18 +1158,27 @@ qeth_string_to_ipaddr6(const char *buf, tmp_addr = (u16 *)addr; start = buf; - for (i = 0; i 7; i++) { - if (!(end = strchr(start, ':'))) + for (i = 0; i 8; i++) { + if (i == 7) { + end = strchr(start,0xa); + if (end) + len = end - start; + else + len = strlen(start); + } + else { + end = strchr(start, ':'); + len = end - start; + } + if ((len = 0) || (len 4)) return -EINVAL; - len = end - start; memset(abuf, 0, 5); strncpy(abuf, start, len); + if (!qeth_isxdigit(abuf)) + return -EINVAL; tmp_addr[i] = simple_strtoul(abuf, tmp, 16); start = end + 1; } - memset(abuf, 0, 5); - strcpy(abuf, start); - tmp_addr[7] = simple_strtoul(abuf, tmp, 16); return 0; } diff -Naupr orig/drivers/s390/net/qeth_sys.c patched-linux/drivers/s390/net/qeth_sys.c --- orig/drivers/s390/net/qeth_sys.c2005-11-09 20:06:57.0 +0100 +++ patched-linux/drivers/s390/net/qeth_sys.c 2005-11-09 20:11:59.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.55 $) + * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $) * * 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.55 $; +const char *VERSION_QETH_SYS_C = $Revision: 1.58 $; /*/ /* */ @@ -1117,7 +1117,7 @@ qeth_parse_ipatoe(const char* buf, enum start = buf; /* get address string */ end = strchr(start, '/'); - if (!end){ + if (!end || (end-start = 49)){ PRINT_WARN(Invalid format for ipato_addx/delx. Use ip addr/mask bits\n); return -EINVAL; - To unsubscribe
[patch 5/7] s390: fix recovery failure of non-guestLAN devices
[patch 5/7] s390: fix recovery failure of non-guestLAN devices From: Frank Pavlic [EMAIL PROTECTED] - Recovery of non-guestLAN Layer 2 device failed due to trying to register the real MAC address we got from the READ_MAC adapter parameters command. We have to keep the old MAC address when we process the reply of a READ_MAC. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] diffstat: qeth.h | 12 ++-- qeth_main.c | 27 --- 2 files changed, 22 insertions(+), 17 deletions(-) diff -Naupr orig/drivers/s390/net/qeth.h patched-linux/drivers/s390/net/qeth.h --- orig/drivers/s390/net/qeth.h2005-11-09 20:16:39.0 +0100 +++ patched-linux/drivers/s390/net/qeth.h 2005-11-09 20:43:33.0 +0100 @@ -25,7 +25,7 @@ #include qeth_mpc.h -#define VERSION_QETH_H $Revision: 1.151 $ +#define VERSION_QETH_H $Revision: 1.152 $ #ifdef CONFIG_QETH_IPV6 #define QETH_VERSION_IPV6 :IPv6 @@ -719,8 +719,6 @@ struct qeth_reply { atomic_t refcnt; }; -#define QETH_BROADCAST_WITH_ECHO1 -#define QETH_BROADCAST_WITHOUT_ECHO 2 struct qeth_card_blkt { int time_total; @@ -728,8 +726,10 @@ struct qeth_card_blkt { int inter_packet_jumbo; }; - - +#define QETH_BROADCAST_WITH_ECHO0x01 +#define QETH_BROADCAST_WITHOUT_ECHO 0x02 +#define QETH_LAYER2_MAC_READ 0x01 +#define QETH_LAYER2_MAC_REGISTERED 0x02 struct qeth_card_info { unsigned short unit_addr2; unsigned short cula; @@ -737,7 +737,7 @@ struct qeth_card_info { __u16 func_level; char mcl_level[QETH_MCL_LENGTH + 1]; int guestlan; - int layer2_mac_registered; + int mac_bits; int portname_required; int portno; char portname[9]; diff -Naupr orig/drivers/s390/net/qeth_main.c patched-linux/drivers/s390/net/qeth_main.c --- orig/drivers/s390/net/qeth_main.c 2005-11-09 20:42:41.0 +0100 +++ patched-linux/drivers/s390/net/qeth_main.c 2005-11-09 20:45:34.0 +0100 @@ -1,6 +1,6 @@ /* * - * linux/drivers/s390/net/qeth_main.c ($Revision: 1.238 $) + * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) * * Linux on zSeries OSA Express and HiperSockets support * @@ -12,7 +12,7 @@ * Frank Pavlic ([EMAIL PROTECTED]) and * Thomas Spatzier [EMAIL PROTECTED] * - *$Revision: 1.238 $$Date: 2005/05/04 20:19:18 $ + *$Revision: 1.242 $$Date: 2005/05/04 20:19:18 $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ #include qeth_eddp.h #include qeth_tso.h -#define VERSION_QETH_C $Revision: 1.238 $ +#define VERSION_QETH_C $Revision: 1.242 $ static const char *version = qeth S/390 OSA-Express driver; /** @@ -3775,7 +3775,7 @@ qeth_open(struct net_device *dev) if ( (card-info.type != QETH_CARD_TYPE_OSN) (card-options.layer2) -(!card-info.layer2_mac_registered)) { +(!(card-info.mac_bits QETH_LAYER2_MAC_REGISTERED))) { QETH_DBF_TEXT(trace,4,nomacadr); return -EPERM; } @@ -5894,10 +5894,10 @@ qeth_layer2_send_setmac_cb(struct qeth_c PRINT_WARN(Error in registering MAC address on \ device %s: x%x\n, CARD_BUS_ID(card), cmd-hdr.return_code); - card-info.layer2_mac_registered = 0; + card-info.mac_bits = ~QETH_LAYER2_MAC_REGISTERED; cmd-hdr.return_code = -EIO; } else { - card-info.layer2_mac_registered = 1; + card-info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; memcpy(card-dev-dev_addr,cmd-data.setdelmac.mac, OSA_ADDR_LEN); PRINT_INFO(MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x @@ -5935,7 +5935,7 @@ qeth_layer2_send_delmac_cb(struct qeth_c cmd-hdr.return_code = -EIO; return 0; } - card-info.layer2_mac_registered = 0; + card-info.mac_bits = ~QETH_LAYER2_MAC_REGISTERED; return 0; } @@ -5943,7 +5943,7 @@ static int qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac) { QETH_DBF_TEXT(trace, 2, L2Delmac); - if (!card-info.layer2_mac_registered) + if (!(card-info.mac_bits QETH_LAYER2_MAC_REGISTERED)) return 0; return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC, qeth_layer2_send_delmac_cb); @@ -5965,7 +5965,7 @@ qeth_layer2_set_mac_address(struct net_d card = (struct qeth_card *) dev-priv; if (!card-options.layer2) { - PRINT_WARN(Setting MAC address on %s is not supported + PRINT_WARN(Setting MAC address on %s