Commit 983f27d3 authored by Jeff Garzik's avatar Jeff Garzik

Merge branch 'upstream-fixes' into upstream

Conflicts:

	drivers/s390/net/ctctty.c
parents de1e938e e82b0f2c
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count) ...@@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count)
int len; int len;
if (!(end = strchr(start, delim[i]))) if (!(end = strchr(start, delim[i])))
return count; return -EINVAL;
len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1);
strlcpy (bus_ids[i], start, len); strlcpy (bus_ids[i], start, len);
argv[i] = bus_ids[i]; argv[i] = bus_ids[i];
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
*/ */
/* #define DEBUG */ /* #define DEBUG */
#include <linux/module.h> #include <linux/module.h>
...@@ -297,7 +297,7 @@ MODULE_LICENSE("GPL"); ...@@ -297,7 +297,7 @@ MODULE_LICENSE("GPL");
/* /*
* Debugging stuff * Debugging stuff
*******************************************************************************/ *******************************************************************************/
#ifdef DEBUG #ifdef DEBUG
static int debuglevel = 0; static int debuglevel = 0;
...@@ -344,7 +344,7 @@ do { \ ...@@ -344,7 +344,7 @@ do { \
/* /*
* Internal functions * Internal functions
*******************************************************************************/ *******************************************************************************/
/** /**
* print start banner * print start banner
*/ */
......
This diff is collapsed.
...@@ -73,13 +73,17 @@ do { \ ...@@ -73,13 +73,17 @@ do { \
/** /**
* LCS sense byte definitions * 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_INTERFACE_DISCONNECT 0x01
#define LCS_SENSE_EQUIPMENT_CHECK 0x10 #define LCS_SENSE_EQUIPMENT_CHECK 0x10
#define LCS_SENSE_BUS_OUT_CHECK 0x20 #define LCS_SENSE_BUS_OUT_CHECK 0x20
#define LCS_SENSE_INTERVENTION_REQUIRED 0x40 #define LCS_SENSE_INTERVENTION_REQUIRED 0x40
#define LCS_SENSE_CMD_REJECT 0x80 #define LCS_SENSE_CMD_REJECT 0x80
#define LCS_SENSE_RESETTING_EVENT 0x0080 #define LCS_SENSE_RESETTING_EVENT 0x80
#define LCS_SENSE_DEVICE_ONLINE 0x0020 #define LCS_SENSE_DEVICE_ONLINE 0x20
/** /**
* LCS packet type definitions * LCS packet type definitions
...@@ -152,10 +156,9 @@ enum lcs_dev_states { ...@@ -152,10 +156,9 @@ enum lcs_dev_states {
enum lcs_threads { enum lcs_threads {
LCS_SET_MC_THREAD = 1, LCS_SET_MC_THREAD = 1,
LCS_STARTLAN_THREAD = 2, LCS_RECOVERY_THREAD = 2,
LCS_STOPLAN_THREAD = 4,
LCS_STARTUP_THREAD = 8,
}; };
/** /**
* LCS struct declarations * LCS struct declarations
*/ */
...@@ -286,6 +289,7 @@ struct lcs_card { ...@@ -286,6 +289,7 @@ struct lcs_card {
struct net_device_stats stats; struct net_device_stats stats;
unsigned short (*lan_type_trans)(struct sk_buff *skb, unsigned short (*lan_type_trans)(struct sk_buff *skb,
struct net_device *dev); struct net_device *dev);
struct ccwgroup_device *gdev;
struct lcs_channel read; struct lcs_channel read;
struct lcs_channel write; struct lcs_channel write;
struct lcs_buffer *tx_buffer; struct lcs_buffer *tx_buffer;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
*/ */
#undef DEBUG #undef DEBUG
#include <linux/module.h> #include <linux/module.h>
...@@ -65,7 +65,7 @@ MODULE_AUTHOR ...@@ -65,7 +65,7 @@ MODULE_AUTHOR
("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)");
MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
#define PRINTK_HEADER " iucv: " /* for debugging */ #define PRINTK_HEADER " iucv: " /* for debugging */
static struct device_driver netiucv_driver = { static struct device_driver netiucv_driver = {
...@@ -202,7 +202,7 @@ netiucv_printname(char *name) ...@@ -202,7 +202,7 @@ netiucv_printname(char *name)
*p = '\0'; *p = '\0';
return tmp; return tmp;
} }
/** /**
* States of the interface statemachine. * States of the interface statemachine.
*/ */
...@@ -244,7 +244,7 @@ static const char *dev_event_names[] = { ...@@ -244,7 +244,7 @@ static const char *dev_event_names[] = {
"Connection up", "Connection up",
"Connection down", "Connection down",
}; };
/** /**
* Events of the connection statemachine * Events of the connection statemachine
*/ */
...@@ -364,7 +364,7 @@ static const char *conn_state_names[] = { ...@@ -364,7 +364,7 @@ static const char *conn_state_names[] = {
"Connect error", "Connect error",
}; };
/** /**
* Debug Facility Stuff * Debug Facility Stuff
*/ */
...@@ -516,7 +516,7 @@ static void ...@@ -516,7 +516,7 @@ static void
fsm_action_nop(fsm_instance *fi, int event, void *arg) fsm_action_nop(fsm_instance *fi, int event, void *arg)
{ {
} }
/** /**
* Actions of the connection statemachine * Actions of the connection statemachine
*****************************************************************************/ *****************************************************************************/
...@@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = { ...@@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = {
static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node);
/** /**
* Actions for interface - statemachine. * Actions for interface - statemachine.
*****************************************************************************/ *****************************************************************************/
...@@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { ...@@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
return rc; return rc;
} }
/** /**
* Interface API for upper network layers * Interface API for upper network layers
*****************************************************************************/ *****************************************************************************/
......
...@@ -1099,7 +1099,7 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) ...@@ -1099,7 +1099,7 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
rc = sscanf(buf, "%d.%d.%d.%d%n", rc = sscanf(buf, "%d.%d.%d.%d%n",
&in[0], &in[1], &in[2], &in[3], &count); &in[0], &in[1], &in[2], &in[3], &count);
if (rc != 4 || count) if (rc != 4 || count<=0)
return -EINVAL; return -EINVAL;
for (count = 0; count < 4; count++) { for (count = 0; count < 4; count++) {
if (in[count] > 255) if (in[count] > 255)
......
...@@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev) ...@@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev)
QETH_DBF_TEXT(trace,4,"nomacadr"); QETH_DBF_TEXT(trace,4,"nomacadr");
return -EPERM; return -EPERM;
} }
card->dev->flags |= IFF_UP;
netif_start_queue(dev);
card->data.state = CH_STATE_UP; card->data.state = CH_STATE_UP;
card->state = CARD_STATE_UP; card->state = CARD_STATE_UP;
card->dev->flags |= IFF_UP;
netif_start_queue(dev);
if (!card->lan_online && netif_carrier_ok(dev)) if (!card->lan_online && netif_carrier_ok(dev))
netif_carrier_off(dev); netif_carrier_off(dev);
...@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev) ...@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev)
card = (struct qeth_card *) dev->priv; card = (struct qeth_card *) dev->priv;
netif_stop_queue(dev); netif_tx_disable(dev);
card->dev->flags &= ~IFF_UP; card->dev->flags &= ~IFF_UP;
if (card->state == CARD_STATE_UP) if (card->state == CARD_STATE_UP)
card->state = CARD_STATE_SOFTSETUP; card->state = CARD_STATE_SOFTSETUP;
...@@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, ...@@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb,
#endif #endif
*hdr = (struct qeth_hdr *) *hdr = (struct qeth_hdr *)
qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); qeth_push_skb(card, skb, sizeof(struct qeth_hdr));
if (hdr == NULL) if (*hdr == NULL)
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
...@@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) ...@@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
struct qeth_eddp_context *ctx = NULL; struct qeth_eddp_context *ctx = NULL;
int tx_bytes = skb->len; 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; int rc;
QETH_DBF_TEXT(trace, 6, "sendpkt"); QETH_DBF_TEXT(trace, 6, "sendpkt");
...@@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) ...@@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
card->stats.tx_packets++; card->stats.tx_packets++;
card->stats.tx_bytes += tx_bytes; card->stats.tx_bytes += tx_bytes;
#ifdef CONFIG_QETH_PERF_STATS #ifdef CONFIG_QETH_PERF_STATS
if (skb_shinfo(skb)->tso_size && if (tso_size &&
!(large_send == QETH_LARGE_SEND_NO)) { !(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++; card->perf_stats.large_send_cnt++;
} }
if (skb_shinfo(skb)->nr_frags > 0){ if (nr_frags > 0){
card->perf_stats.sg_skbs_sent++; card->perf_stats.sg_skbs_sent++;
/* nr_frags + skb->data */ /* nr_frags + skb->data */
card->perf_stats.sg_frags_sent += card->perf_stats.sg_frags_sent +=
skb_shinfo(skb)->nr_frags + 1; nr_frags + 1;
} }
#endif /* CONFIG_QETH_PERF_STATS */ #endif /* CONFIG_QETH_PERF_STATS */
} }
...@@ -6359,12 +6361,9 @@ qeth_netdev_init(struct net_device *dev) ...@@ -6359,12 +6361,9 @@ qeth_netdev_init(struct net_device *dev)
dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
#endif #endif
dev->hard_header = card->orig_hard_header;
if (qeth_get_netdev_flags(card) & IFF_NOARP) { if (qeth_get_netdev_flags(card) & IFF_NOARP) {
dev->rebuild_header = NULL; dev->rebuild_header = NULL;
dev->hard_header = NULL; dev->hard_header = NULL;
if (card->options.fake_ll)
dev->hard_header = qeth_fake_header;
dev->header_cache_update = NULL; dev->header_cache_update = NULL;
dev->hard_header_cache = NULL; dev->hard_header_cache = NULL;
} }
...@@ -6373,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev) ...@@ -6373,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev)
if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
card->dev->dev_id = card->info.unique_id & 0xffff; card->dev->dev_id = card->info.unique_id & 0xffff;
#endif #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->hard_header_parse = NULL;
dev->set_mac_address = qeth_layer2_set_mac_address; dev->set_mac_address = qeth_layer2_set_mac_address;
dev->flags |= qeth_get_netdev_flags(card); dev->flags |= qeth_get_netdev_flags(card);
...@@ -6477,6 +6479,9 @@ qeth_hardsetup_card(struct qeth_card *card) ...@@ -6477,6 +6479,9 @@ qeth_hardsetup_card(struct qeth_card *card)
/*network device will be recovered*/ /*network device will be recovered*/
if (card->dev) { if (card->dev) {
card->dev->hard_header = card->orig_hard_header; 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; return 0;
} }
/* at first set_online allocate netdev */ /* at first set_online allocate netdev */
...@@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card) ...@@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card)
QETH_DBF_TEXT(trace,3,"softipv6"); QETH_DBF_TEXT(trace,3,"softipv6");
netif_stop_queue(card->dev);
rc = qeth_send_startlan(card, QETH_PROT_IPV6); rc = qeth_send_startlan(card, QETH_PROT_IPV6);
if (rc) { if (rc) {
PRINT_ERR("IPv6 startlan failed on %s\n", PRINT_ERR("IPv6 startlan failed on %s\n",
QETH_CARD_IFNAME(card)); QETH_CARD_IFNAME(card));
return rc; return rc;
} }
netif_wake_queue(card->dev);
rc = qeth_query_ipassists(card,QETH_PROT_IPV6); rc = qeth_query_ipassists(card,QETH_PROT_IPV6);
if (rc) { if (rc) {
PRINT_ERR("IPv6 query ipassist failed on %s\n", PRINT_ERR("IPv6 query ipassist failed on %s\n",
...@@ -7352,7 +7355,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) ...@@ -7352,7 +7355,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
card->options.large_send = type; card->options.large_send = type;
return 0; return 0;
} }
netif_stop_queue(card->dev); if (card->state == CARD_STATE_UP)
netif_tx_disable(card->dev);
card->options.large_send = type; card->options.large_send = type;
switch (card->options.large_send) { switch (card->options.large_send) {
case QETH_LARGE_SEND_EDDP: case QETH_LARGE_SEND_EDDP:
...@@ -7374,6 +7378,7 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) ...@@ -7374,6 +7378,7 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
break; break;
} }
if (card->state == CARD_STATE_UP)
netif_wake_queue(card->dev); netif_wake_queue(card->dev);
return rc; return rc;
} }
...@@ -7427,7 +7432,7 @@ qeth_softsetup_card(struct qeth_card *card) ...@@ -7427,7 +7432,7 @@ qeth_softsetup_card(struct qeth_card *card)
if ((rc = qeth_setrouting_v6(card))) if ((rc = qeth_setrouting_v6(card)))
QETH_DBF_TEXT_(setup, 2, "5err%d", rc); QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
out: out:
netif_stop_queue(card->dev); netif_tx_disable(card->dev);
return 0; return 0;
} }
...@@ -7736,10 +7741,8 @@ static int ...@@ -7736,10 +7741,8 @@ static int
qeth_register_netdev(struct qeth_card *card) qeth_register_netdev(struct qeth_card *card)
{ {
QETH_DBF_TEXT(setup, 3, "regnetd"); QETH_DBF_TEXT(setup, 3, "regnetd");
if (card->dev->reg_state != NETREG_UNINITIALIZED) { if (card->dev->reg_state != NETREG_UNINITIALIZED)
qeth_netdev_init(card->dev);
return 0; return 0;
}
/* sysfs magic */ /* sysfs magic */
SET_NETDEV_DEV(card->dev, &card->gdev->dev); SET_NETDEV_DEV(card->dev, &card->gdev->dev);
return register_netdev(card->dev); return register_netdev(card->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment