diff options
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth.h | 26 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 24 | ||||
-rw-r--r-- | drivers/s390/net/qeth_proc.c | 126 |
3 files changed, 95 insertions, 81 deletions
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 008e0a5d2eb3..3a0285669adf 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -824,7 +824,7 @@ extern struct list_head qeth_notify_list; | |||
824 | 824 | ||
825 | #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") | 825 | #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") |
826 | 826 | ||
827 | inline static __u8 | 827 | static inline __u8 |
828 | qeth_get_ipa_adp_type(enum qeth_link_types link_type) | 828 | qeth_get_ipa_adp_type(enum qeth_link_types link_type) |
829 | { | 829 | { |
830 | switch (link_type) { | 830 | switch (link_type) { |
@@ -835,7 +835,7 @@ qeth_get_ipa_adp_type(enum qeth_link_types link_type) | |||
835 | } | 835 | } |
836 | } | 836 | } |
837 | 837 | ||
838 | inline static int | 838 | static inline int |
839 | qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size) | 839 | qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size) |
840 | { | 840 | { |
841 | struct sk_buff *new_skb = NULL; | 841 | struct sk_buff *new_skb = NULL; |
@@ -852,6 +852,7 @@ qeth_realloc_headroom(struct qeth_card *card, struct sk_buff **skb, int size) | |||
852 | } | 852 | } |
853 | return 0; | 853 | return 0; |
854 | } | 854 | } |
855 | |||
855 | static inline struct sk_buff * | 856 | static inline struct sk_buff * |
856 | qeth_pskb_unshare(struct sk_buff *skb, int pri) | 857 | qeth_pskb_unshare(struct sk_buff *skb, int pri) |
857 | { | 858 | { |
@@ -863,8 +864,7 @@ qeth_pskb_unshare(struct sk_buff *skb, int pri) | |||
863 | return nskb; | 864 | return nskb; |
864 | } | 865 | } |
865 | 866 | ||
866 | 867 | static inline void * | |
867 | inline static void * | ||
868 | qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size) | 868 | qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size) |
869 | { | 869 | { |
870 | void *hdr; | 870 | void *hdr; |
@@ -887,7 +887,7 @@ qeth_push_skb(struct qeth_card *card, struct sk_buff **skb, int size) | |||
887 | } | 887 | } |
888 | 888 | ||
889 | 889 | ||
890 | inline static int | 890 | static inline int |
891 | qeth_get_hlen(__u8 link_type) | 891 | qeth_get_hlen(__u8 link_type) |
892 | { | 892 | { |
893 | #ifdef CONFIG_QETH_IPV6 | 893 | #ifdef CONFIG_QETH_IPV6 |
@@ -911,7 +911,7 @@ qeth_get_hlen(__u8 link_type) | |||
911 | #endif /* CONFIG_QETH_IPV6 */ | 911 | #endif /* CONFIG_QETH_IPV6 */ |
912 | } | 912 | } |
913 | 913 | ||
914 | inline static unsigned short | 914 | static inline unsigned short |
915 | qeth_get_netdev_flags(struct qeth_card *card) | 915 | qeth_get_netdev_flags(struct qeth_card *card) |
916 | { | 916 | { |
917 | if (card->options.layer2) | 917 | if (card->options.layer2) |
@@ -929,7 +929,7 @@ qeth_get_netdev_flags(struct qeth_card *card) | |||
929 | } | 929 | } |
930 | } | 930 | } |
931 | 931 | ||
932 | inline static int | 932 | static inline int |
933 | qeth_get_initial_mtu_for_card(struct qeth_card * card) | 933 | qeth_get_initial_mtu_for_card(struct qeth_card * card) |
934 | { | 934 | { |
935 | switch (card->info.type) { | 935 | switch (card->info.type) { |
@@ -950,7 +950,7 @@ qeth_get_initial_mtu_for_card(struct qeth_card * card) | |||
950 | } | 950 | } |
951 | } | 951 | } |
952 | 952 | ||
953 | inline static int | 953 | static inline int |
954 | qeth_get_max_mtu_for_card(int cardtype) | 954 | qeth_get_max_mtu_for_card(int cardtype) |
955 | { | 955 | { |
956 | switch (cardtype) { | 956 | switch (cardtype) { |
@@ -965,7 +965,7 @@ qeth_get_max_mtu_for_card(int cardtype) | |||
965 | } | 965 | } |
966 | } | 966 | } |
967 | 967 | ||
968 | inline static int | 968 | static inline int |
969 | qeth_get_mtu_out_of_mpc(int cardtype) | 969 | qeth_get_mtu_out_of_mpc(int cardtype) |
970 | { | 970 | { |
971 | switch (cardtype) { | 971 | switch (cardtype) { |
@@ -976,7 +976,7 @@ qeth_get_mtu_out_of_mpc(int cardtype) | |||
976 | } | 976 | } |
977 | } | 977 | } |
978 | 978 | ||
979 | inline static int | 979 | static inline int |
980 | qeth_get_mtu_outof_framesize(int framesize) | 980 | qeth_get_mtu_outof_framesize(int framesize) |
981 | { | 981 | { |
982 | switch (framesize) { | 982 | switch (framesize) { |
@@ -993,7 +993,7 @@ qeth_get_mtu_outof_framesize(int framesize) | |||
993 | } | 993 | } |
994 | } | 994 | } |
995 | 995 | ||
996 | inline static int | 996 | static inline int |
997 | qeth_mtu_is_valid(struct qeth_card * card, int mtu) | 997 | qeth_mtu_is_valid(struct qeth_card * card, int mtu) |
998 | { | 998 | { |
999 | switch (card->info.type) { | 999 | switch (card->info.type) { |
@@ -1008,7 +1008,7 @@ qeth_mtu_is_valid(struct qeth_card * card, int mtu) | |||
1008 | } | 1008 | } |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | inline static int | 1011 | static inline int |
1012 | qeth_get_arphdr_type(int cardtype, int linktype) | 1012 | qeth_get_arphdr_type(int cardtype, int linktype) |
1013 | { | 1013 | { |
1014 | switch (cardtype) { | 1014 | switch (cardtype) { |
@@ -1027,7 +1027,7 @@ qeth_get_arphdr_type(int cardtype, int linktype) | |||
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | #ifdef CONFIG_QETH_PERF_STATS | 1029 | #ifdef CONFIG_QETH_PERF_STATS |
1030 | inline static int | 1030 | static inline int |
1031 | qeth_get_micros(void) | 1031 | qeth_get_micros(void) |
1032 | { | 1032 | { |
1033 | return (int) (get_clock() >> 12); | 1033 | return (int) (get_clock() >> 12); |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 8f4d2999af8e..79c74f3a11f5 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = { | |||
8120 | #endif | 8120 | #endif |
8121 | 8121 | ||
8122 | static int | 8122 | static int |
8123 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) | 8123 | __qeth_reboot_event_card(struct device *dev, void *data) |
8124 | { | 8124 | { |
8125 | |||
8126 | struct device *entry; | ||
8127 | struct qeth_card *card; | 8125 | struct qeth_card *card; |
8128 | 8126 | ||
8129 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8127 | card = (struct qeth_card *) dev->driver_data; |
8130 | list_for_each_entry(entry, &qeth_ccwgroup_driver.driver.devices, | 8128 | qeth_clear_ip_list(card, 0, 0); |
8131 | driver_list) { | 8129 | qeth_qdio_clear_card(card, 0); |
8132 | card = (struct qeth_card *) entry->driver_data; | 8130 | return 0; |
8133 | qeth_clear_ip_list(card, 0, 0); | 8131 | } |
8134 | qeth_qdio_clear_card(card, 0); | 8132 | |
8135 | } | 8133 | static int |
8136 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8134 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) |
8135 | { | ||
8136 | |||
8137 | driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
8138 | __qeth_reboot_event_card); | ||
8137 | return NOTIFY_DONE; | 8139 | return NOTIFY_DONE; |
8138 | } | 8140 | } |
8139 | 8141 | ||
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 04719196fd20..f2ccfea8fdb8 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c | |||
@@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; | |||
27 | #define QETH_PROCFILE_NAME "qeth" | 27 | #define QETH_PROCFILE_NAME "qeth" |
28 | static struct proc_dir_entry *qeth_procfile; | 28 | static struct proc_dir_entry *qeth_procfile; |
29 | 29 | ||
30 | static int | ||
31 | qeth_procfile_seq_match(struct device *dev, void *data) | ||
32 | { | ||
33 | return 1; | ||
34 | } | ||
35 | |||
30 | static void * | 36 | static void * |
31 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) | 37 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) |
32 | { | 38 | { |
33 | struct list_head *next_card = NULL; | 39 | struct device *dev; |
34 | int i = 0; | 40 | loff_t nr; |
35 | 41 | ||
36 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 42 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
37 | 43 | ||
38 | if (*offset == 0) | 44 | nr = *offset; |
45 | if (nr == 0) | ||
39 | return SEQ_START_TOKEN; | 46 | return SEQ_START_TOKEN; |
40 | 47 | ||
41 | /* get card at pos *offset */ | 48 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, |
42 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices) | 49 | NULL, qeth_procfile_seq_match); |
43 | if (++i == *offset) | ||
44 | return next_card; | ||
45 | 50 | ||
46 | return NULL; | 51 | /* get card at pos *offset */ |
52 | nr = *offset; | ||
53 | while (nr-- > 1 && dev) | ||
54 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
55 | NULL, qeth_procfile_seq_match); | ||
56 | return (void *) dev; | ||
47 | } | 57 | } |
48 | 58 | ||
49 | static void | 59 | static void |
@@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it) | |||
55 | static void * | 65 | static void * |
56 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 66 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
57 | { | 67 | { |
58 | struct list_head *next_card = NULL; | 68 | struct device *prev, *next; |
59 | struct list_head *current_card; | ||
60 | 69 | ||
61 | if (it == SEQ_START_TOKEN) { | 70 | if (it == SEQ_START_TOKEN) { |
62 | next_card = qeth_ccwgroup_driver.driver.devices.next; | 71 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
63 | if (next_card->next == next_card) /* list empty */ | 72 | NULL, NULL, qeth_procfile_seq_match); |
64 | return NULL; | 73 | if (next) |
65 | (*offset)++; | 74 | (*offset)++; |
66 | } else { | 75 | return (void *) next; |
67 | current_card = (struct list_head *)it; | ||
68 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
69 | return NULL; /* end of list reached */ | ||
70 | next_card = current_card->next; | ||
71 | (*offset)++; | ||
72 | } | 76 | } |
73 | 77 | prev = (struct device *) it; | |
74 | return next_card; | 78 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
79 | prev, NULL, qeth_procfile_seq_match); | ||
80 | if (next) | ||
81 | (*offset)++; | ||
82 | return (void *) next; | ||
75 | } | 83 | } |
76 | 84 | ||
77 | static inline const char * | 85 | static inline const char * |
@@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) | |||
126 | "-------------- ---- ------ ---------- ---- " | 134 | "-------------- ---- ------ ---------- ---- " |
127 | "---- ----- -----\n"); | 135 | "---- ----- -----\n"); |
128 | } else { | 136 | } else { |
129 | device = list_entry(it, struct device, driver_list); | 137 | device = (struct device *) it; |
130 | card = device->driver_data; | 138 | card = device->driver_data; |
131 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", | 139 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", |
132 | CARD_RDEV_ID(card), | 140 | CARD_RDEV_ID(card), |
@@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile; | |||
180 | static void * | 188 | static void * |
181 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) | 189 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) |
182 | { | 190 | { |
183 | struct list_head *next_card = NULL; | 191 | struct device *dev = NULL; |
184 | int i = 0; | 192 | int nr; |
185 | 193 | ||
186 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 194 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
187 | /* get card at pos *offset */ | 195 | /* get card at pos *offset */ |
188 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 196 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, |
189 | if (i == *offset) | 197 | qeth_procfile_seq_match); |
190 | return next_card; | 198 | |
191 | i++; | 199 | /* get card at pos *offset */ |
192 | } | 200 | nr = *offset; |
193 | return NULL; | 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; | ||
194 | } | 205 | } |
195 | 206 | ||
196 | static void | 207 | static void |
@@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) | |||
202 | static void * | 213 | static void * |
203 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 214 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
204 | { | 215 | { |
205 | struct list_head *current_card = (struct list_head *)it; | 216 | struct device *prev, *next; |
206 | 217 | ||
207 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | 218 | prev = (struct device *) it; |
208 | return NULL; /* end of list reached */ | 219 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
209 | (*offset)++; | 220 | NULL, qeth_procfile_seq_match); |
210 | return current_card->next; | 221 | if (next) |
222 | (*offset)++; | ||
223 | return (void *) next; | ||
211 | } | 224 | } |
212 | 225 | ||
213 | static int | 226 | static int |
@@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | |||
216 | struct device *device; | 229 | struct device *device; |
217 | struct qeth_card *card; | 230 | struct qeth_card *card; |
218 | 231 | ||
219 | device = list_entry(it, struct device, driver_list); | 232 | device = (struct device *) it; |
220 | card = device->driver_data; | 233 | card = device->driver_data; |
221 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", | 234 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", |
222 | CARD_RDEV_ID(card), | 235 | CARD_RDEV_ID(card), |
@@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile; | |||
318 | static void * | 331 | static void * |
319 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | 332 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) |
320 | { | 333 | { |
321 | struct list_head *next_card = NULL; | 334 | struct device *dev; |
322 | int i = 0; | 335 | loff_t nr; |
323 | 336 | ||
324 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 337 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
325 | /* TODO: finish this */ | 338 | /* TODO: finish this */ |
@@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | |||
328 | * output driver settings then; | 341 | * output driver settings then; |
329 | * else output setting for respective card | 342 | * else output setting for respective card |
330 | */ | 343 | */ |
344 | |||
345 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
346 | qeth_procfile_seq_match); | ||
347 | |||
331 | /* get card at pos *offset */ | 348 | /* get card at pos *offset */ |
332 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 349 | nr = *offset; |
333 | if (i == *offset) | 350 | while (nr-- > 1 && dev) |
334 | return next_card; | 351 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, |
335 | i++; | 352 | NULL, qeth_procfile_seq_match); |
336 | } | 353 | return (void *) dev; |
337 | return NULL; | ||
338 | } | 354 | } |
339 | 355 | ||
340 | static void | 356 | static void |
@@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) | |||
346 | static void * | 362 | static void * |
347 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 363 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
348 | { | 364 | { |
349 | struct list_head *current_card = (struct list_head *)it; | 365 | struct device *prev, *next; |
350 | 366 | ||
351 | /* TODO: finish this */ | 367 | prev = (struct device *) it; |
352 | /* | 368 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
353 | * maybe SEQ_SATRT_TOKEN can be returned for offset 0 | 369 | NULL, qeth_procfile_seq_match); |
354 | * output driver settings then; | 370 | if (next) |
355 | * else output setting for respective card | 371 | (*offset)++; |
356 | */ | 372 | return (void *) next; |
357 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
358 | return NULL; /* end of list reached */ | ||
359 | (*offset)++; | ||
360 | return current_card->next; | ||
361 | } | 373 | } |
362 | 374 | ||
363 | static int | 375 | static int |
@@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) | |||
372 | * output driver settings then; | 384 | * output driver settings then; |
373 | * else output setting for respective card | 385 | * else output setting for respective card |
374 | */ | 386 | */ |
375 | device = list_entry(it, struct device, driver_list); | 387 | device = (struct device *) it; |
376 | card = device->driver_data; | 388 | card = device->driver_data; |
377 | 389 | ||
378 | return 0; | 390 | return 0; |