diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-24 14:55:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-24 14:55:16 -0500 |
commit | a7c2491a13cc72fc09c062e635b9a77ff6bb4a73 (patch) | |
tree | f8f4ed7bbc05369aadfd32668b892fe2740a0f3b | |
parent | 1836098f97d22c81652aeeec64d1819dc2177bdb (diff) | |
parent | 3df3cc6d18b6dcd38c33c198fb8adf1f1fa5f4a7 (diff) |
Merge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
-rw-r--r-- | drivers/net/phy/phy_device.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/orinoco_nortel.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/qeth_eddp.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 61 | ||||
-rw-r--r-- | drivers/s390/net/qeth_mpc.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/qeth_mpc.h | 4 | ||||
-rw-r--r-- | drivers/s390/net/qeth_proc.c | 250 | ||||
-rw-r--r-- | drivers/s390/net/qeth_sys.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/qeth_tso.h | 4 |
9 files changed, 77 insertions, 263 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 16bebe7a7ce1..7da0e3dd5fe3 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -38,6 +38,10 @@ | |||
38 | #include <asm/irq.h> | 38 | #include <asm/irq.h> |
39 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
40 | 40 | ||
41 | MODULE_DESCRIPTION("PHY library"); | ||
42 | MODULE_AUTHOR("Andy Fleming"); | ||
43 | MODULE_LICENSE("GPL"); | ||
44 | |||
41 | static struct phy_driver genphy_driver; | 45 | static struct phy_driver genphy_driver; |
42 | extern int mdio_bus_init(void); | 46 | extern int mdio_bus_init(void); |
43 | extern void mdio_bus_exit(void); | 47 | extern void mdio_bus_exit(void); |
diff --git a/drivers/net/wireless/orinoco_nortel.c b/drivers/net/wireless/orinoco_nortel.c index d8afd51ff8a5..d1a670b35338 100644 --- a/drivers/net/wireless/orinoco_nortel.c +++ b/drivers/net/wireless/orinoco_nortel.c | |||
@@ -1,6 +1,8 @@ | |||
1 | /* orinoco_nortel.c | 1 | /* orinoco_nortel.c |
2 | * | 2 | * |
3 | * Driver for Prism II devices which would usually be driven by orinoco_cs, | 3 | * Driver for Prism II devices which would usually be driven by orinoco_cs, |
4 | * but are connected to the PCI bus by a PCI-to-PCMCIA adapter used in | ||
5 | * Nortel emobility, Symbol LA-4113 and Symbol LA-4123. | ||
4 | * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. | 6 | * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. |
5 | * | 7 | * |
6 | * Copyright (C) 2002 Tobias Hoffmann | 8 | * Copyright (C) 2002 Tobias Hoffmann |
@@ -165,7 +167,7 @@ static int nortel_pci_init_one(struct pci_dev *pdev, | |||
165 | goto fail_resources; | 167 | goto fail_resources; |
166 | } | 168 | } |
167 | 169 | ||
168 | iomem = pci_iomap(pdev, 3, 0); | 170 | iomem = pci_iomap(pdev, 2, 0); |
169 | if (!iomem) { | 171 | if (!iomem) { |
170 | err = -ENOMEM; | 172 | err = -ENOMEM; |
171 | goto fail_map_io; | 173 | goto fail_map_io; |
@@ -265,6 +267,8 @@ static void __devexit nortel_pci_remove_one(struct pci_dev *pdev) | |||
265 | static struct pci_device_id nortel_pci_id_table[] = { | 267 | static struct pci_device_id nortel_pci_id_table[] = { |
266 | /* Nortel emobility PCI */ | 268 | /* Nortel emobility PCI */ |
267 | {0x126c, 0x8030, PCI_ANY_ID, PCI_ANY_ID,}, | 269 | {0x126c, 0x8030, PCI_ANY_ID, PCI_ANY_ID,}, |
270 | /* Symbol LA-4123 PCI */ | ||
271 | {0x1562, 0x0001, PCI_ANY_ID, PCI_ANY_ID,}, | ||
268 | {0,}, | 272 | {0,}, |
269 | }; | 273 | }; |
270 | 274 | ||
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 011915d5e243..f94f1f25eec6 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c | |||
@@ -62,7 +62,8 @@ qeth_eddp_free_context(struct qeth_eddp_context *ctx) | |||
62 | for (i = 0; i < ctx->num_pages; ++i) | 62 | for (i = 0; i < ctx->num_pages; ++i) |
63 | free_page((unsigned long)ctx->pages[i]); | 63 | free_page((unsigned long)ctx->pages[i]); |
64 | kfree(ctx->pages); | 64 | kfree(ctx->pages); |
65 | kfree(ctx->elements); | 65 | if (ctx->elements != NULL) |
66 | kfree(ctx->elements); | ||
66 | kfree(ctx); | 67 | kfree(ctx); |
67 | } | 68 | } |
68 | 69 | ||
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 99cceb242ec4..f8f55cc468ba 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) | 3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * | 6 | * |
@@ -12,7 +12,7 @@ | |||
12 | * Frank Pavlic (fpavlic@de.ibm.com) and | 12 | * Frank Pavlic (fpavlic@de.ibm.com) and |
13 | * Thomas Spatzier <tspat@de.ibm.com> | 13 | * Thomas Spatzier <tspat@de.ibm.com> |
14 | * | 14 | * |
15 | * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $ | 15 | * $Revision: 1.251 $ $Date: 2005/05/04 20:19:18 $ |
16 | * | 16 | * |
17 | * This program is free software; you can redistribute it and/or modify | 17 | * This program is free software; you can redistribute it and/or modify |
18 | * it under the terms of the GNU General Public License as published by | 18 | * it under the terms of the GNU General Public License as published by |
@@ -72,7 +72,7 @@ | |||
72 | #include "qeth_eddp.h" | 72 | #include "qeth_eddp.h" |
73 | #include "qeth_tso.h" | 73 | #include "qeth_tso.h" |
74 | 74 | ||
75 | #define VERSION_QETH_C "$Revision: 1.242 $" | 75 | #define VERSION_QETH_C "$Revision: 1.251 $" |
76 | static const char *version = "qeth S/390 OSA-Express driver"; | 76 | static const char *version = "qeth S/390 OSA-Express driver"; |
77 | 77 | ||
78 | /** | 78 | /** |
@@ -518,7 +518,8 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) | |||
518 | 518 | ||
519 | QETH_DBF_TEXT(setup, 3, "setoffl"); | 519 | QETH_DBF_TEXT(setup, 3, "setoffl"); |
520 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); | 520 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); |
521 | 521 | ||
522 | netif_carrier_off(card->dev); | ||
522 | recover_flag = card->state; | 523 | recover_flag = card->state; |
523 | if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ | 524 | if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ |
524 | PRINT_WARN("Stopping card %s interrupted by user!\n", | 525 | PRINT_WARN("Stopping card %s interrupted by user!\n", |
@@ -1020,7 +1021,6 @@ void | |||
1020 | qeth_schedule_recovery(struct qeth_card *card) | 1021 | qeth_schedule_recovery(struct qeth_card *card) |
1021 | { | 1022 | { |
1022 | QETH_DBF_TEXT(trace,2,"startrec"); | 1023 | QETH_DBF_TEXT(trace,2,"startrec"); |
1023 | |||
1024 | if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) | 1024 | if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) |
1025 | schedule_work(&card->kernel_thread_starter); | 1025 | schedule_work(&card->kernel_thread_starter); |
1026 | } | 1026 | } |
@@ -1710,7 +1710,6 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) | |||
1710 | "IP address reset.\n", | 1710 | "IP address reset.\n", |
1711 | QETH_CARD_IFNAME(card), | 1711 | QETH_CARD_IFNAME(card), |
1712 | card->info.chpid); | 1712 | card->info.chpid); |
1713 | netif_carrier_on(card->dev); | ||
1714 | qeth_schedule_recovery(card); | 1713 | qeth_schedule_recovery(card); |
1715 | return NULL; | 1714 | return NULL; |
1716 | case IPA_CMD_MODCCID: | 1715 | case IPA_CMD_MODCCID: |
@@ -1959,7 +1958,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, | |||
1959 | { | 1958 | { |
1960 | u16 s1, s2; | 1959 | u16 s1, s2; |
1961 | 1960 | ||
1962 | QETH_DBF_TEXT(trace,4,"osndipa"); | 1961 | QETH_DBF_TEXT(trace,4,"osndipa"); |
1963 | 1962 | ||
1964 | qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); | 1963 | qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); |
1965 | s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); | 1964 | s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); |
@@ -2203,24 +2202,21 @@ qeth_ulp_setup(struct qeth_card *card) | |||
2203 | } | 2202 | } |
2204 | 2203 | ||
2205 | static inline int | 2204 | static inline int |
2206 | qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, | 2205 | qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, |
2207 | unsigned int qdio_error, | 2206 | unsigned int siga_error, const char *dbftext) |
2208 | unsigned int siga_error) | ||
2209 | { | 2207 | { |
2210 | int rc = 0; | ||
2211 | |||
2212 | if (qdio_error || siga_error) { | 2208 | if (qdio_error || siga_error) { |
2213 | QETH_DBF_TEXT(trace, 2, "qdinerr"); | 2209 | QETH_DBF_TEXT(trace, 2, dbftext); |
2214 | QETH_DBF_TEXT(qerr, 2, "qdinerr"); | 2210 | QETH_DBF_TEXT(qerr, 2, dbftext); |
2215 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", | 2211 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", |
2216 | buf->buffer->element[15].flags & 0xff); | 2212 | buf->element[15].flags & 0xff); |
2217 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", | 2213 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", |
2218 | buf->buffer->element[14].flags & 0xff); | 2214 | buf->element[14].flags & 0xff); |
2219 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); | 2215 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); |
2220 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); | 2216 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); |
2221 | rc = 1; | 2217 | return 1; |
2222 | } | 2218 | } |
2223 | return rc; | 2219 | return 0; |
2224 | } | 2220 | } |
2225 | 2221 | ||
2226 | static inline struct sk_buff * | 2222 | static inline struct sk_buff * |
@@ -2769,8 +2765,9 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2769 | for (i = first_element; i < (first_element + count); ++i) { | 2765 | for (i = first_element; i < (first_element + count); ++i) { |
2770 | index = i % QDIO_MAX_BUFFERS_PER_Q; | 2766 | index = i % QDIO_MAX_BUFFERS_PER_Q; |
2771 | buffer = &card->qdio.in_q->bufs[index]; | 2767 | buffer = &card->qdio.in_q->bufs[index]; |
2772 | if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) && | 2768 | if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && |
2773 | qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) | 2769 | qeth_check_qdio_errors(buffer->buffer, |
2770 | qdio_err, siga_err,"qinerr"))) | ||
2774 | qeth_process_inbound_buffer(card, buffer, index); | 2771 | qeth_process_inbound_buffer(card, buffer, index); |
2775 | /* clear buffer and give back to hardware */ | 2772 | /* clear buffer and give back to hardware */ |
2776 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); | 2773 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); |
@@ -2785,12 +2782,13 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2785 | static inline int | 2782 | static inline int |
2786 | qeth_handle_send_error(struct qeth_card *card, | 2783 | qeth_handle_send_error(struct qeth_card *card, |
2787 | struct qeth_qdio_out_buffer *buffer, | 2784 | struct qeth_qdio_out_buffer *buffer, |
2788 | int qdio_err, int siga_err) | 2785 | unsigned int qdio_err, unsigned int siga_err) |
2789 | { | 2786 | { |
2790 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; | 2787 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; |
2791 | int cc = siga_err & 3; | 2788 | int cc = siga_err & 3; |
2792 | 2789 | ||
2793 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); | 2790 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); |
2791 | qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr"); | ||
2794 | switch (cc) { | 2792 | switch (cc) { |
2795 | case 0: | 2793 | case 0: |
2796 | if (qdio_err){ | 2794 | if (qdio_err){ |
@@ -3047,7 +3045,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status, | |||
3047 | for(i = first_element; i < (first_element + count); ++i){ | 3045 | for(i = first_element; i < (first_element + count); ++i){ |
3048 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; | 3046 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; |
3049 | /*we only handle the KICK_IT error by doing a recovery */ | 3047 | /*we only handle the KICK_IT error by doing a recovery */ |
3050 | if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) | 3048 | if (qeth_handle_send_error(card, buffer, |
3049 | qdio_error, siga_error) | ||
3051 | == QETH_SEND_ERROR_KICK_IT){ | 3050 | == QETH_SEND_ERROR_KICK_IT){ |
3052 | netif_stop_queue(card->dev); | 3051 | netif_stop_queue(card->dev); |
3053 | qeth_schedule_recovery(card); | 3052 | qeth_schedule_recovery(card); |
@@ -3289,7 +3288,6 @@ qeth_init_qdio_info(struct qeth_card *card) | |||
3289 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; | 3288 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; |
3290 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); | 3289 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); |
3291 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); | 3290 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); |
3292 | /* outbound */ | ||
3293 | } | 3291 | } |
3294 | 3292 | ||
3295 | static int | 3293 | static int |
@@ -3731,6 +3729,9 @@ qeth_verify_vlan_dev(struct net_device *dev, struct qeth_card *card) | |||
3731 | break; | 3729 | break; |
3732 | } | 3730 | } |
3733 | } | 3731 | } |
3732 | if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card)) | ||
3733 | return 0; | ||
3734 | |||
3734 | #endif | 3735 | #endif |
3735 | return rc; | 3736 | return rc; |
3736 | } | 3737 | } |
@@ -3807,10 +3808,8 @@ qeth_open(struct net_device *dev) | |||
3807 | card->data.state = CH_STATE_UP; | 3808 | card->data.state = CH_STATE_UP; |
3808 | card->state = CARD_STATE_UP; | 3809 | card->state = CARD_STATE_UP; |
3809 | 3810 | ||
3810 | if (!card->lan_online){ | 3811 | if (!card->lan_online && netif_carrier_ok(dev)) |
3811 | if (netif_carrier_ok(dev)) | 3812 | netif_carrier_off(dev); |
3812 | netif_carrier_off(dev); | ||
3813 | } | ||
3814 | return 0; | 3813 | return 0; |
3815 | } | 3814 | } |
3816 | 3815 | ||
@@ -5870,10 +5869,8 @@ qeth_add_multicast_ipv6(struct qeth_card *card) | |||
5870 | struct inet6_dev *in6_dev; | 5869 | struct inet6_dev *in6_dev; |
5871 | 5870 | ||
5872 | QETH_DBF_TEXT(trace,4,"chkmcv6"); | 5871 | QETH_DBF_TEXT(trace,4,"chkmcv6"); |
5873 | if ((card->options.layer2 == 0) && | 5872 | if (!qeth_is_supported(card, IPA_IPV6)) |
5874 | (!qeth_is_supported(card, IPA_IPV6)) ) | ||
5875 | return ; | 5873 | return ; |
5876 | |||
5877 | in6_dev = in6_dev_get(card->dev); | 5874 | in6_dev = in6_dev_get(card->dev); |
5878 | if (in6_dev == NULL) | 5875 | if (in6_dev == NULL) |
5879 | return; | 5876 | return; |
@@ -7936,8 +7933,8 @@ __qeth_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
7936 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); | 7933 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); |
7937 | goto out_remove; | 7934 | goto out_remove; |
7938 | } | 7935 | } |
7939 | /*maybe it was set offline without ifconfig down | 7936 | netif_carrier_on(card->dev); |
7940 | * we can also use this state for recovery purposes*/ | 7937 | |
7941 | qeth_set_allowed_threads(card, 0xffffffff, 0); | 7938 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
7942 | if (recover_flag == CARD_STATE_RECOVER) | 7939 | if (recover_flag == CARD_STATE_RECOVER) |
7943 | qeth_start_again(card, recovery_mode); | 7940 | qeth_start_again(card, recovery_mode); |
diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c index f0a080a9e515..5f8754addc14 100644 --- a/drivers/s390/net/qeth_mpc.c +++ b/drivers/s390/net/qeth_mpc.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <asm/cio.h> | 11 | #include <asm/cio.h> |
12 | #include "qeth_mpc.h" | 12 | #include "qeth_mpc.h" |
13 | 13 | ||
14 | const char *VERSION_QETH_MPC_C = "$Revision: 1.12 $"; | 14 | const char *VERSION_QETH_MPC_C = "$Revision: 1.13 $"; |
15 | 15 | ||
16 | unsigned char IDX_ACTIVATE_READ[]={ | 16 | unsigned char IDX_ACTIVATE_READ[]={ |
17 | 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00, | 17 | 0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00, |
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h index 5f71486e708c..864cec5f6c62 100644 --- a/drivers/s390/net/qeth_mpc.h +++ b/drivers/s390/net/qeth_mpc.h | |||
@@ -14,14 +14,14 @@ | |||
14 | 14 | ||
15 | #include <asm/qeth.h> | 15 | #include <asm/qeth.h> |
16 | 16 | ||
17 | #define VERSION_QETH_MPC_H "$Revision: 1.44 $" | 17 | #define VERSION_QETH_MPC_H "$Revision: 1.46 $" |
18 | 18 | ||
19 | extern const char *VERSION_QETH_MPC_C; | 19 | extern const char *VERSION_QETH_MPC_C; |
20 | 20 | ||
21 | #define IPA_PDU_HEADER_SIZE 0x40 | 21 | #define IPA_PDU_HEADER_SIZE 0x40 |
22 | #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) | 22 | #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) |
23 | #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) | 23 | #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) |
24 | #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a) | 24 | #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29) |
25 | #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) | 25 | #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) |
26 | 26 | ||
27 | extern unsigned char IPA_PDU_HEADER[]; | 27 | extern unsigned char IPA_PDU_HEADER[]; |
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index f2ccfea8fdb8..7bf35098831e 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $) | 3 | * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * This file contains code related to procfs. | 6 | * This file contains code related to procfs. |
@@ -21,7 +21,7 @@ | |||
21 | #include "qeth_mpc.h" | 21 | #include "qeth_mpc.h" |
22 | #include "qeth_fs.h" | 22 | #include "qeth_fs.h" |
23 | 23 | ||
24 | const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; | 24 | const char *VERSION_QETH_PROC_C = "$Revision: 1.16 $"; |
25 | 25 | ||
26 | /***** /proc/qeth *****/ | 26 | /***** /proc/qeth *****/ |
27 | #define QETH_PROCFILE_NAME "qeth" | 27 | #define QETH_PROCFILE_NAME "qeth" |
@@ -30,30 +30,26 @@ static struct proc_dir_entry *qeth_procfile; | |||
30 | static int | 30 | static int |
31 | qeth_procfile_seq_match(struct device *dev, void *data) | 31 | qeth_procfile_seq_match(struct device *dev, void *data) |
32 | { | 32 | { |
33 | return 1; | 33 | return(dev ? 1 : 0); |
34 | } | 34 | } |
35 | 35 | ||
36 | static void * | 36 | static void * |
37 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) | 37 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) |
38 | { | 38 | { |
39 | struct device *dev; | 39 | struct device *dev = NULL; |
40 | loff_t nr; | 40 | loff_t nr = 0; |
41 | 41 | ||
42 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 42 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
43 | 43 | if (*offset == 0) | |
44 | nr = *offset; | ||
45 | if (nr == 0) | ||
46 | return SEQ_START_TOKEN; | 44 | return SEQ_START_TOKEN; |
47 | 45 | while (1) { | |
48 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, | ||
49 | NULL, qeth_procfile_seq_match); | ||
50 | |||
51 | /* get card at pos *offset */ | ||
52 | nr = *offset; | ||
53 | while (nr-- > 1 && dev) | ||
54 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | 46 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, |
55 | NULL, qeth_procfile_seq_match); | 47 | NULL, qeth_procfile_seq_match); |
56 | return (void *) dev; | 48 | if (++nr == *offset) |
49 | break; | ||
50 | put_device(dev); | ||
51 | } | ||
52 | return dev; | ||
57 | } | 53 | } |
58 | 54 | ||
59 | static void | 55 | static void |
@@ -66,19 +62,14 @@ static void * | |||
66 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 62 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
67 | { | 63 | { |
68 | struct device *prev, *next; | 64 | struct device *prev, *next; |
69 | 65 | ||
70 | if (it == SEQ_START_TOKEN) { | 66 | if (it == SEQ_START_TOKEN) |
71 | next = driver_find_device(&qeth_ccwgroup_driver.driver, | 67 | prev = NULL; |
72 | NULL, NULL, qeth_procfile_seq_match); | 68 | else |
73 | if (next) | 69 | prev = (struct device *) it; |
74 | (*offset)++; | ||
75 | return (void *) next; | ||
76 | } | ||
77 | prev = (struct device *) it; | ||
78 | next = driver_find_device(&qeth_ccwgroup_driver.driver, | 70 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
79 | prev, NULL, qeth_procfile_seq_match); | 71 | prev, NULL, qeth_procfile_seq_match); |
80 | if (next) | 72 | (*offset)++; |
81 | (*offset)++; | ||
82 | return (void *) next; | 73 | return (void *) next; |
83 | } | 74 | } |
84 | 75 | ||
@@ -87,7 +78,7 @@ qeth_get_router_str(struct qeth_card *card, int ipv) | |||
87 | { | 78 | { |
88 | int routing_type = 0; | 79 | int routing_type = 0; |
89 | 80 | ||
90 | if (ipv == 4){ | 81 | if (ipv == 4) { |
91 | routing_type = card->options.route4.type; | 82 | routing_type = card->options.route4.type; |
92 | } else { | 83 | } else { |
93 | #ifdef CONFIG_QETH_IPV6 | 84 | #ifdef CONFIG_QETH_IPV6 |
@@ -154,6 +145,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) | |||
154 | card->qdio.in_buf_pool.buf_count); | 145 | card->qdio.in_buf_pool.buf_count); |
155 | else | 146 | else |
156 | seq_printf(s, " +++ LAN OFFLINE +++\n"); | 147 | seq_printf(s, " +++ LAN OFFLINE +++\n"); |
148 | put_device(device); | ||
157 | } | 149 | } |
158 | return 0; | 150 | return 0; |
159 | } | 151 | } |
@@ -184,51 +176,16 @@ static struct file_operations qeth_procfile_fops = { | |||
184 | static struct proc_dir_entry *qeth_perf_procfile; | 176 | static struct proc_dir_entry *qeth_perf_procfile; |
185 | 177 | ||
186 | #ifdef CONFIG_QETH_PERF_STATS | 178 | #ifdef CONFIG_QETH_PERF_STATS |
187 | |||
188 | static void * | ||
189 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) | ||
190 | { | ||
191 | struct device *dev = NULL; | ||
192 | int nr; | ||
193 | |||
194 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
195 | /* get card at pos *offset */ | ||
196 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
197 | qeth_procfile_seq_match); | ||
198 | |||
199 | /* get card at pos *offset */ | ||
200 | nr = *offset; | ||
201 | while (nr-- > 1 && dev) | ||
202 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
203 | NULL, qeth_procfile_seq_match); | ||
204 | return (void *) dev; | ||
205 | } | ||
206 | |||
207 | static void | ||
208 | qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) | ||
209 | { | ||
210 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
211 | } | ||
212 | |||
213 | static void * | ||
214 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | ||
215 | { | ||
216 | struct device *prev, *next; | ||
217 | |||
218 | prev = (struct device *) it; | ||
219 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, | ||
220 | NULL, qeth_procfile_seq_match); | ||
221 | if (next) | ||
222 | (*offset)++; | ||
223 | return (void *) next; | ||
224 | } | ||
225 | |||
226 | static int | 179 | static int |
227 | qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | 180 | qeth_perf_procfile_seq_show(struct seq_file *s, void *it) |
228 | { | 181 | { |
229 | struct device *device; | 182 | struct device *device; |
230 | struct qeth_card *card; | 183 | struct qeth_card *card; |
231 | 184 | ||
185 | |||
186 | if (it == SEQ_START_TOKEN) | ||
187 | return 0; | ||
188 | |||
232 | device = (struct device *) it; | 189 | device = (struct device *) it; |
233 | card = device->driver_data; | 190 | card = device->driver_data; |
234 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", | 191 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", |
@@ -295,13 +252,14 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | |||
295 | card->perf_stats.outbound_do_qdio_time, | 252 | card->perf_stats.outbound_do_qdio_time, |
296 | card->perf_stats.outbound_do_qdio_cnt | 253 | card->perf_stats.outbound_do_qdio_cnt |
297 | ); | 254 | ); |
255 | put_device(device); | ||
298 | return 0; | 256 | return 0; |
299 | } | 257 | } |
300 | 258 | ||
301 | static struct seq_operations qeth_perf_procfile_seq_ops = { | 259 | static struct seq_operations qeth_perf_procfile_seq_ops = { |
302 | .start = qeth_perf_procfile_seq_start, | 260 | .start = qeth_procfile_seq_start, |
303 | .stop = qeth_perf_procfile_seq_stop, | 261 | .stop = qeth_procfile_seq_stop, |
304 | .next = qeth_perf_procfile_seq_next, | 262 | .next = qeth_procfile_seq_next, |
305 | .show = qeth_perf_procfile_seq_show, | 263 | .show = qeth_perf_procfile_seq_show, |
306 | }; | 264 | }; |
307 | 265 | ||
@@ -324,93 +282,6 @@ static struct file_operations qeth_perf_procfile_fops = { | |||
324 | #define qeth_perf_procfile_created 1 | 282 | #define qeth_perf_procfile_created 1 |
325 | #endif /* CONFIG_QETH_PERF_STATS */ | 283 | #endif /* CONFIG_QETH_PERF_STATS */ |
326 | 284 | ||
327 | /***** /proc/qeth_ipa_takeover *****/ | ||
328 | #define QETH_IPATO_PROCFILE_NAME "qeth_ipa_takeover" | ||
329 | static struct proc_dir_entry *qeth_ipato_procfile; | ||
330 | |||
331 | static void * | ||
332 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | ||
333 | { | ||
334 | struct device *dev; | ||
335 | loff_t nr; | ||
336 | |||
337 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
338 | /* TODO: finish this */ | ||
339 | /* | ||
340 | * maybe SEQ_SATRT_TOKEN can be returned for offset 0 | ||
341 | * output driver settings then; | ||
342 | * else output setting for respective card | ||
343 | */ | ||
344 | |||
345 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
346 | qeth_procfile_seq_match); | ||
347 | |||
348 | /* get card at pos *offset */ | ||
349 | nr = *offset; | ||
350 | while (nr-- > 1 && dev) | ||
351 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
352 | NULL, qeth_procfile_seq_match); | ||
353 | return (void *) dev; | ||
354 | } | ||
355 | |||
356 | static void | ||
357 | qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) | ||
358 | { | ||
359 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
360 | } | ||
361 | |||
362 | static void * | ||
363 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | ||
364 | { | ||
365 | struct device *prev, *next; | ||
366 | |||
367 | prev = (struct device *) it; | ||
368 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, | ||
369 | NULL, qeth_procfile_seq_match); | ||
370 | if (next) | ||
371 | (*offset)++; | ||
372 | return (void *) next; | ||
373 | } | ||
374 | |||
375 | static int | ||
376 | qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) | ||
377 | { | ||
378 | struct device *device; | ||
379 | struct qeth_card *card; | ||
380 | |||
381 | /* TODO: finish this */ | ||
382 | /* | ||
383 | * maybe SEQ_SATRT_TOKEN can be returned for offset 0 | ||
384 | * output driver settings then; | ||
385 | * else output setting for respective card | ||
386 | */ | ||
387 | device = (struct device *) it; | ||
388 | card = device->driver_data; | ||
389 | |||
390 | return 0; | ||
391 | } | ||
392 | |||
393 | static struct seq_operations qeth_ipato_procfile_seq_ops = { | ||
394 | .start = qeth_ipato_procfile_seq_start, | ||
395 | .stop = qeth_ipato_procfile_seq_stop, | ||
396 | .next = qeth_ipato_procfile_seq_next, | ||
397 | .show = qeth_ipato_procfile_seq_show, | ||
398 | }; | ||
399 | |||
400 | static int | ||
401 | qeth_ipato_procfile_open(struct inode *inode, struct file *file) | ||
402 | { | ||
403 | return seq_open(file, &qeth_ipato_procfile_seq_ops); | ||
404 | } | ||
405 | |||
406 | static struct file_operations qeth_ipato_procfile_fops = { | ||
407 | .owner = THIS_MODULE, | ||
408 | .open = qeth_ipato_procfile_open, | ||
409 | .read = seq_read, | ||
410 | .llseek = seq_lseek, | ||
411 | .release = seq_release, | ||
412 | }; | ||
413 | |||
414 | int __init | 285 | int __init |
415 | qeth_create_procfs_entries(void) | 286 | qeth_create_procfs_entries(void) |
416 | { | 287 | { |
@@ -426,13 +297,7 @@ qeth_create_procfs_entries(void) | |||
426 | qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; | 297 | qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops; |
427 | #endif /* CONFIG_QETH_PERF_STATS */ | 298 | #endif /* CONFIG_QETH_PERF_STATS */ |
428 | 299 | ||
429 | qeth_ipato_procfile = create_proc_entry(QETH_IPATO_PROCFILE_NAME, | ||
430 | S_IFREG | 0444, NULL); | ||
431 | if (qeth_ipato_procfile) | ||
432 | qeth_ipato_procfile->proc_fops = &qeth_ipato_procfile_fops; | ||
433 | |||
434 | if (qeth_procfile && | 300 | if (qeth_procfile && |
435 | qeth_ipato_procfile && | ||
436 | qeth_perf_procfile_created) | 301 | qeth_perf_procfile_created) |
437 | return 0; | 302 | return 0; |
438 | else | 303 | else |
@@ -446,62 +311,5 @@ qeth_remove_procfs_entries(void) | |||
446 | remove_proc_entry(QETH_PROCFILE_NAME, NULL); | 311 | remove_proc_entry(QETH_PROCFILE_NAME, NULL); |
447 | if (qeth_perf_procfile) | 312 | if (qeth_perf_procfile) |
448 | remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); | 313 | remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL); |
449 | if (qeth_ipato_procfile) | ||
450 | remove_proc_entry(QETH_IPATO_PROCFILE_NAME, NULL); | ||
451 | } | 314 | } |
452 | 315 | ||
453 | |||
454 | /* ONLY FOR DEVELOPMENT! -> make it as module */ | ||
455 | /* | ||
456 | static void | ||
457 | qeth_create_sysfs_entries(void) | ||
458 | { | ||
459 | struct device *dev; | ||
460 | |||
461 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
462 | |||
463 | list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, | ||
464 | driver_list) | ||
465 | qeth_create_device_attributes(dev); | ||
466 | |||
467 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
468 | } | ||
469 | |||
470 | static void | ||
471 | qeth_remove_sysfs_entries(void) | ||
472 | { | ||
473 | struct device *dev; | ||
474 | |||
475 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
476 | |||
477 | list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices, | ||
478 | driver_list) | ||
479 | qeth_remove_device_attributes(dev); | ||
480 | |||
481 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | ||
482 | } | ||
483 | |||
484 | static int __init | ||
485 | qeth_fs_init(void) | ||
486 | { | ||
487 | printk(KERN_INFO "qeth_fs_init\n"); | ||
488 | qeth_create_procfs_entries(); | ||
489 | qeth_create_sysfs_entries(); | ||
490 | |||
491 | return 0; | ||
492 | } | ||
493 | |||
494 | static void __exit | ||
495 | qeth_fs_exit(void) | ||
496 | { | ||
497 | printk(KERN_INFO "qeth_fs_exit\n"); | ||
498 | qeth_remove_procfs_entries(); | ||
499 | qeth_remove_sysfs_entries(); | ||
500 | } | ||
501 | |||
502 | |||
503 | module_init(qeth_fs_init); | ||
504 | module_exit(qeth_fs_exit); | ||
505 | |||
506 | MODULE_LICENSE("GPL"); | ||
507 | */ | ||
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index ddd6019ba092..0ea185f70f75 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $) | 3 | * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.60 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * This file contains code related to sysfs. | 6 | * This file contains code related to sysfs. |
@@ -20,7 +20,7 @@ | |||
20 | #include "qeth_mpc.h" | 20 | #include "qeth_mpc.h" |
21 | #include "qeth_fs.h" | 21 | #include "qeth_fs.h" |
22 | 22 | ||
23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $"; | 23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.60 $"; |
24 | 24 | ||
25 | /*****************************************************************************/ | 25 | /*****************************************************************************/ |
26 | /* */ | 26 | /* */ |
@@ -160,7 +160,7 @@ qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const | |||
160 | return -EPERM; | 160 | return -EPERM; |
161 | 161 | ||
162 | tmp = strsep((char **) &buf, "\n"); | 162 | tmp = strsep((char **) &buf, "\n"); |
163 | if ((strlen(tmp) > 8) || (strlen(tmp) < 2)) | 163 | if ((strlen(tmp) > 8) || (strlen(tmp) == 0)) |
164 | return -EINVAL; | 164 | return -EINVAL; |
165 | 165 | ||
166 | card->info.portname[0] = strlen(tmp); | 166 | card->info.portname[0] = strlen(tmp); |
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h index e245af3c4cbd..3c50b6f24f51 100644 --- a/drivers/s390/net/qeth_tso.h +++ b/drivers/s390/net/qeth_tso.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $) | 2 | * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.8 $) |
3 | * | 3 | * |
4 | * Header file for qeth TCP Segmentation Offload support. | 4 | * Header file for qeth TCP Segmentation Offload support. |
5 | * | 5 | * |
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * Author(s): Frank Pavlic <fpavlic@de.ibm.com> | 8 | * Author(s): Frank Pavlic <fpavlic@de.ibm.com> |
9 | * | 9 | * |
10 | * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ | 10 | * $Revision: 1.8 $ $Date: 2005/05/04 20:19:18 $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #ifndef __QETH_TSO_H__ | 13 | #ifndef __QETH_TSO_H__ |