3 * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.55 $)
5 * Linux on zSeries OSA Express and HiperSockets support
6 * This file contains code related to sysfs.
8 * Copyright 2000,2003 IBM Corporation
10 * Author(s): Thomas Spatzier <tspat@de.ibm.com>
11 * Frank Pavlic <pavlic@de.ibm.com>
14 #include <linux/list.h>
15 #include <linux/rwsem.h>
17 #include <asm/ebcdic.h>
23 const char *VERSION_QETH_SYS_C = "$Revision: 1.55 $";
25 /*****************************************************************************/
27 /* /sys-fs stuff UNDER DEVELOPMENT !!! */
29 /*****************************************************************************/
33 qeth_dev_state_show(struct device *dev, struct device_attribute *attr, char *buf)
35 struct qeth_card *card = dev->driver_data;
39 switch (card->state) {
41 return sprintf(buf, "DOWN\n");
42 case CARD_STATE_HARDSETUP:
43 return sprintf(buf, "HARDSETUP\n");
44 case CARD_STATE_SOFTSETUP:
45 return sprintf(buf, "SOFTSETUP\n");
48 return sprintf(buf, "UP (LAN ONLINE)\n");
50 return sprintf(buf, "UP (LAN OFFLINE)\n");
51 case CARD_STATE_RECOVER:
52 return sprintf(buf, "RECOVER\n");
54 return sprintf(buf, "UNKNOWN\n");
58 static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL);
61 qeth_dev_chpid_show(struct device *dev, struct device_attribute *attr, char *buf)
63 struct qeth_card *card = dev->driver_data;
67 return sprintf(buf, "%02X\n", card->info.chpid);
70 static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL);
73 qeth_dev_if_name_show(struct device *dev, struct device_attribute *attr, char *buf)
75 struct qeth_card *card = dev->driver_data;
78 return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
81 static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
84 qeth_dev_card_type_show(struct device *dev, struct device_attribute *attr, char *buf)
86 struct qeth_card *card = dev->driver_data;
90 return sprintf(buf, "%s\n", qeth_get_cardname_short(card));
93 static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
96 qeth_dev_portno_show(struct device *dev, struct device_attribute *attr, char *buf)
98 struct qeth_card *card = dev->driver_data;
102 return sprintf(buf, "%i\n", card->info.portno);
106 qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
108 struct qeth_card *card = dev->driver_data;
115 if ((card->state != CARD_STATE_DOWN) &&
116 (card->state != CARD_STATE_RECOVER))
119 portno = simple_strtoul(buf, &tmp, 16);
120 if ((portno < 0) || (portno > MAX_PORTNO)){
121 PRINT_WARN("portno 0x%X is out of range\n", portno);
125 card->info.portno = portno;
129 static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store);
132 qeth_dev_portname_show(struct device *dev, struct device_attribute *attr, char *buf)
134 struct qeth_card *card = dev->driver_data;
135 char portname[9] = {0, };
140 if (card->info.portname_required) {
141 memcpy(portname, card->info.portname + 1, 8);
143 return sprintf(buf, "%s\n", portname);
145 return sprintf(buf, "no portname required\n");
149 qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
151 struct qeth_card *card = dev->driver_data;
158 if ((card->state != CARD_STATE_DOWN) &&
159 (card->state != CARD_STATE_RECOVER))
162 tmp = strsep((char **) &buf, "\n");
163 if ((strlen(tmp) > 8) || (strlen(tmp) < 2))
166 card->info.portname[0] = strlen(tmp);
167 /* for beauty reasons */
168 for (i = 1; i < 9; i++)
169 card->info.portname[i] = ' ';
170 strcpy(card->info.portname + 1, tmp);
171 ASCEBC(card->info.portname + 1, 8);
176 static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show,
177 qeth_dev_portname_store);
180 qeth_dev_checksum_show(struct device *dev, struct device_attribute *attr, char *buf)
182 struct qeth_card *card = dev->driver_data;
187 return sprintf(buf, "%s checksumming\n", qeth_get_checksum_str(card));
191 qeth_dev_checksum_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
193 struct qeth_card *card = dev->driver_data;
199 if ((card->state != CARD_STATE_DOWN) &&
200 (card->state != CARD_STATE_RECOVER))
203 tmp = strsep((char **) &buf, "\n");
204 if (!strcmp(tmp, "sw_checksumming"))
205 card->options.checksum_type = SW_CHECKSUMMING;
206 else if (!strcmp(tmp, "hw_checksumming"))
207 card->options.checksum_type = HW_CHECKSUMMING;
208 else if (!strcmp(tmp, "no_checksumming"))
209 card->options.checksum_type = NO_CHECKSUMMING;
211 PRINT_WARN("Unknown checksumming type '%s'\n", tmp);
217 static DEVICE_ATTR(checksumming, 0644, qeth_dev_checksum_show,
218 qeth_dev_checksum_store);
221 qeth_dev_prioqing_show(struct device *dev, struct device_attribute *attr, char *buf)
223 struct qeth_card *card = dev->driver_data;
228 switch (card->qdio.do_prio_queueing) {
229 case QETH_PRIO_Q_ING_PREC:
230 return sprintf(buf, "%s\n", "by precedence");
231 case QETH_PRIO_Q_ING_TOS:
232 return sprintf(buf, "%s\n", "by type of service");
234 return sprintf(buf, "always queue %i\n",
235 card->qdio.default_out_queue);
240 qeth_dev_prioqing_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
242 struct qeth_card *card = dev->driver_data;
248 if ((card->state != CARD_STATE_DOWN) &&
249 (card->state != CARD_STATE_RECOVER))
252 /* check if 1920 devices are supported ,
253 * if though we have to permit priority queueing
255 if (card->qdio.no_out_queues == 1) {
256 PRINT_WARN("Priority queueing disabled due "
257 "to hardware limitations!\n");
258 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
262 tmp = strsep((char **) &buf, "\n");
263 if (!strcmp(tmp, "prio_queueing_prec"))
264 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
265 else if (!strcmp(tmp, "prio_queueing_tos"))
266 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
267 else if (!strcmp(tmp, "no_prio_queueing:0")) {
268 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
269 card->qdio.default_out_queue = 0;
270 } else if (!strcmp(tmp, "no_prio_queueing:1")) {
271 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
272 card->qdio.default_out_queue = 1;
273 } else if (!strcmp(tmp, "no_prio_queueing:2")) {
274 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
275 card->qdio.default_out_queue = 2;
276 } else if (!strcmp(tmp, "no_prio_queueing:3")) {
277 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
278 card->qdio.default_out_queue = 3;
279 } else if (!strcmp(tmp, "no_prio_queueing")) {
280 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
281 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
283 PRINT_WARN("Unknown queueing type '%s'\n", tmp);
289 static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
290 qeth_dev_prioqing_store);
293 qeth_dev_bufcnt_show(struct device *dev, struct device_attribute *attr, char *buf)
295 struct qeth_card *card = dev->driver_data;
300 return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count);
304 qeth_dev_bufcnt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
306 struct qeth_card *card = dev->driver_data;
314 if ((card->state != CARD_STATE_DOWN) &&
315 (card->state != CARD_STATE_RECOVER))
318 old_cnt = card->qdio.in_buf_pool.buf_count;
319 cnt = simple_strtoul(buf, &tmp, 10);
320 cnt = (cnt < QETH_IN_BUF_COUNT_MIN) ? QETH_IN_BUF_COUNT_MIN :
321 ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
322 if (old_cnt != cnt) {
323 if ((rc = qeth_realloc_buffer_pool(card, cnt)))
324 PRINT_WARN("Error (%d) while setting "
325 "buffer count.\n", rc);
330 static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
331 qeth_dev_bufcnt_store);
333 static inline ssize_t
334 qeth_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route,
337 switch (route->type) {
339 return sprintf(buf, "%s\n", "primary router");
340 case SECONDARY_ROUTER:
341 return sprintf(buf, "%s\n", "secondary router");
342 case MULTICAST_ROUTER:
343 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
344 return sprintf(buf, "%s\n", "multicast router+");
346 return sprintf(buf, "%s\n", "multicast router");
347 case PRIMARY_CONNECTOR:
348 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
349 return sprintf(buf, "%s\n", "primary connector+");
351 return sprintf(buf, "%s\n", "primary connector");
352 case SECONDARY_CONNECTOR:
353 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
354 return sprintf(buf, "%s\n", "secondary connector+");
356 return sprintf(buf, "%s\n", "secondary connector");
358 return sprintf(buf, "%s\n", "no");
363 qeth_dev_route4_show(struct device *dev, struct device_attribute *attr, char *buf)
365 struct qeth_card *card = dev->driver_data;
370 return qeth_dev_route_show(card, &card->options.route4, buf);
373 static inline ssize_t
374 qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route,
375 enum qeth_prot_versions prot, const char *buf, size_t count)
377 enum qeth_routing_types old_route_type = route->type;
381 tmp = strsep((char **) &buf, "\n");
383 if (!strcmp(tmp, "no_router")){
384 route->type = NO_ROUTER;
385 } else if (!strcmp(tmp, "primary_connector")) {
386 route->type = PRIMARY_CONNECTOR;
387 } else if (!strcmp(tmp, "secondary_connector")) {
388 route->type = SECONDARY_CONNECTOR;
389 } else if (!strcmp(tmp, "multicast_router")) {
390 route->type = MULTICAST_ROUTER;
391 } else if (!strcmp(tmp, "primary_router")) {
392 route->type = PRIMARY_ROUTER;
393 } else if (!strcmp(tmp, "secondary_router")) {
394 route->type = SECONDARY_ROUTER;
395 } else if (!strcmp(tmp, "multicast_router")) {
396 route->type = MULTICAST_ROUTER;
398 PRINT_WARN("Invalid routing type '%s'.\n", tmp);
401 if (((card->state == CARD_STATE_SOFTSETUP) ||
402 (card->state == CARD_STATE_UP)) &&
403 (old_route_type != route->type)){
404 if (prot == QETH_PROT_IPV4)
405 rc = qeth_setrouting_v4(card);
406 else if (prot == QETH_PROT_IPV6)
407 rc = qeth_setrouting_v6(card);
413 qeth_dev_route4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
415 struct qeth_card *card = dev->driver_data;
420 return qeth_dev_route_store(card, &card->options.route4,
421 QETH_PROT_IPV4, buf, count);
424 static DEVICE_ATTR(route4, 0644, qeth_dev_route4_show, qeth_dev_route4_store);
426 #ifdef CONFIG_QETH_IPV6
428 qeth_dev_route6_show(struct device *dev, struct device_attribute *attr, char *buf)
430 struct qeth_card *card = dev->driver_data;
435 if (!qeth_is_supported(card, IPA_IPV6))
436 return sprintf(buf, "%s\n", "n/a");
438 return qeth_dev_route_show(card, &card->options.route6, buf);
442 qeth_dev_route6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
444 struct qeth_card *card = dev->driver_data;
449 if (!qeth_is_supported(card, IPA_IPV6)){
450 PRINT_WARN("IPv6 not supported for interface %s.\n"
451 "Routing status no changed.\n",
452 QETH_CARD_IFNAME(card));
456 return qeth_dev_route_store(card, &card->options.route6,
457 QETH_PROT_IPV6, buf, count);
460 static DEVICE_ATTR(route6, 0644, qeth_dev_route6_show, qeth_dev_route6_store);
464 qeth_dev_add_hhlen_show(struct device *dev, struct device_attribute *attr, char *buf)
466 struct qeth_card *card = dev->driver_data;
471 return sprintf(buf, "%i\n", card->options.add_hhlen);
475 qeth_dev_add_hhlen_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
477 struct qeth_card *card = dev->driver_data;
484 if ((card->state != CARD_STATE_DOWN) &&
485 (card->state != CARD_STATE_RECOVER))
488 i = simple_strtoul(buf, &tmp, 10);
489 if ((i < 0) || (i > MAX_ADD_HHLEN)) {
490 PRINT_WARN("add_hhlen out of range\n");
493 card->options.add_hhlen = i;
498 static DEVICE_ATTR(add_hhlen, 0644, qeth_dev_add_hhlen_show,
499 qeth_dev_add_hhlen_store);
502 qeth_dev_fake_ll_show(struct device *dev, struct device_attribute *attr, char *buf)
504 struct qeth_card *card = dev->driver_data;
509 return sprintf(buf, "%i\n", card->options.fake_ll? 1:0);
513 qeth_dev_fake_ll_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
515 struct qeth_card *card = dev->driver_data;
522 if ((card->state != CARD_STATE_DOWN) &&
523 (card->state != CARD_STATE_RECOVER))
526 i = simple_strtoul(buf, &tmp, 16);
527 if ((i != 0) && (i != 1)) {
528 PRINT_WARN("fake_ll: write 0 or 1 to this file!\n");
531 card->options.fake_ll = i;
535 static DEVICE_ATTR(fake_ll, 0644, qeth_dev_fake_ll_show,
536 qeth_dev_fake_ll_store);
539 qeth_dev_fake_broadcast_show(struct device *dev, struct device_attribute *attr, char *buf)
541 struct qeth_card *card = dev->driver_data;
546 return sprintf(buf, "%i\n", card->options.fake_broadcast? 1:0);
550 qeth_dev_fake_broadcast_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
552 struct qeth_card *card = dev->driver_data;
559 if ((card->state != CARD_STATE_DOWN) &&
560 (card->state != CARD_STATE_RECOVER))
563 i = simple_strtoul(buf, &tmp, 16);
564 if ((i == 0) || (i == 1))
565 card->options.fake_broadcast = i;
567 PRINT_WARN("fake_broadcast: write 0 or 1 to this file!\n");
573 static DEVICE_ATTR(fake_broadcast, 0644, qeth_dev_fake_broadcast_show,
574 qeth_dev_fake_broadcast_store);
577 qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
579 struct qeth_card *card = dev->driver_data;
586 if (card->state != CARD_STATE_UP)
589 i = simple_strtoul(buf, &tmp, 16);
591 qeth_schedule_recovery(card);
596 static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store);
599 qeth_dev_broadcast_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
601 struct qeth_card *card = dev->driver_data;
606 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
607 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
608 return sprintf(buf, "n/a\n");
610 return sprintf(buf, "%s\n", (card->options.broadcast_mode ==
611 QETH_TR_BROADCAST_ALLRINGS)?
612 "all rings":"local");
616 qeth_dev_broadcast_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
618 struct qeth_card *card = dev->driver_data;
624 if ((card->state != CARD_STATE_DOWN) &&
625 (card->state != CARD_STATE_RECOVER))
628 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
629 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))){
630 PRINT_WARN("Device is not a tokenring device!\n");
634 tmp = strsep((char **) &buf, "\n");
636 if (!strcmp(tmp, "local")){
637 card->options.broadcast_mode = QETH_TR_BROADCAST_LOCAL;
639 } else if (!strcmp(tmp, "all_rings")) {
640 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
643 PRINT_WARN("broadcast_mode: invalid mode %s!\n",
650 static DEVICE_ATTR(broadcast_mode, 0644, qeth_dev_broadcast_mode_show,
651 qeth_dev_broadcast_mode_store);
654 qeth_dev_canonical_macaddr_show(struct device *dev, struct device_attribute *attr, char *buf)
656 struct qeth_card *card = dev->driver_data;
661 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
662 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
663 return sprintf(buf, "n/a\n");
665 return sprintf(buf, "%i\n", (card->options.macaddr_mode ==
666 QETH_TR_MACADDR_CANONICAL)? 1:0);
670 qeth_dev_canonical_macaddr_store(struct device *dev, struct device_attribute *attr, const char *buf,
673 struct qeth_card *card = dev->driver_data;
680 if ((card->state != CARD_STATE_DOWN) &&
681 (card->state != CARD_STATE_RECOVER))
684 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
685 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))){
686 PRINT_WARN("Device is not a tokenring device!\n");
690 i = simple_strtoul(buf, &tmp, 16);
691 if ((i == 0) || (i == 1))
692 card->options.macaddr_mode = i?
693 QETH_TR_MACADDR_CANONICAL :
694 QETH_TR_MACADDR_NONCANONICAL;
696 PRINT_WARN("canonical_macaddr: write 0 or 1 to this file!\n");
702 static DEVICE_ATTR(canonical_macaddr, 0644, qeth_dev_canonical_macaddr_show,
703 qeth_dev_canonical_macaddr_store);
706 qeth_dev_layer2_show(struct device *dev, struct device_attribute *attr, char *buf)
708 struct qeth_card *card = dev->driver_data;
713 return sprintf(buf, "%i\n", card->options.layer2 ? 1:0);
717 qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
719 struct qeth_card *card = dev->driver_data;
725 if (card->info.type == QETH_CARD_TYPE_IQD) {
726 PRINT_WARN("Layer2 on Hipersockets is not supported! \n");
730 if (((card->state != CARD_STATE_DOWN) &&
731 (card->state != CARD_STATE_RECOVER)))
734 i = simple_strtoul(buf, &tmp, 16);
735 if ((i == 0) || (i == 1))
736 card->options.layer2 = i;
738 PRINT_WARN("layer2: write 0 or 1 to this file!\n");
744 static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show,
745 qeth_dev_layer2_store);
748 qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf)
750 struct qeth_card *card = dev->driver_data;
755 switch (card->options.large_send) {
756 case QETH_LARGE_SEND_NO:
757 return sprintf(buf, "%s\n", "no");
758 case QETH_LARGE_SEND_EDDP:
759 return sprintf(buf, "%s\n", "EDDP");
760 case QETH_LARGE_SEND_TSO:
761 return sprintf(buf, "%s\n", "TSO");
763 return sprintf(buf, "%s\n", "N/A");
768 qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
770 struct qeth_card *card = dev->driver_data;
771 enum qeth_large_send_types type;
777 tmp = strsep((char **) &buf, "\n");
778 if (!strcmp(tmp, "no")){
779 type = QETH_LARGE_SEND_NO;
780 } else if (!strcmp(tmp, "EDDP")) {
781 type = QETH_LARGE_SEND_EDDP;
782 } else if (!strcmp(tmp, "TSO")) {
783 type = QETH_LARGE_SEND_TSO;
785 PRINT_WARN("large_send: invalid mode %s!\n", tmp);
788 if (card->options.large_send == type)
790 if ((rc = qeth_set_large_send(card, type)))
795 static DEVICE_ATTR(large_send, 0644, qeth_dev_large_send_show,
796 qeth_dev_large_send_store);
799 qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value )
805 return sprintf(buf, "%i\n", value);
809 qeth_dev_blkt_store(struct qeth_card *card, const char *buf, size_t count,
810 int *value, int max_value)
818 if ((card->state != CARD_STATE_DOWN) &&
819 (card->state != CARD_STATE_RECOVER))
822 i = simple_strtoul(buf, &tmp, 10);
823 if (i <= max_value) {
826 PRINT_WARN("blkt total time: write values between"
827 " 0 and %d to this file!\n", max_value);
834 qeth_dev_blkt_total_show(struct device *dev, struct device_attribute *attr, char *buf)
836 struct qeth_card *card = dev->driver_data;
838 return qeth_dev_blkt_show(buf, card, card->info.blkt.time_total);
843 qeth_dev_blkt_total_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
845 struct qeth_card *card = dev->driver_data;
847 return qeth_dev_blkt_store(card, buf, count,
848 &card->info.blkt.time_total,1000);
853 static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show,
854 qeth_dev_blkt_total_store);
857 qeth_dev_blkt_inter_show(struct device *dev, struct device_attribute *attr, char *buf)
859 struct qeth_card *card = dev->driver_data;
861 return qeth_dev_blkt_show(buf, card, card->info.blkt.inter_packet);
866 qeth_dev_blkt_inter_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
868 struct qeth_card *card = dev->driver_data;
870 return qeth_dev_blkt_store(card, buf, count,
871 &card->info.blkt.inter_packet,100);
874 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show,
875 qeth_dev_blkt_inter_store);
878 qeth_dev_blkt_inter_jumbo_show(struct device *dev, struct device_attribute *attr, char *buf)
880 struct qeth_card *card = dev->driver_data;
882 return qeth_dev_blkt_show(buf, card,
883 card->info.blkt.inter_packet_jumbo);
888 qeth_dev_blkt_inter_jumbo_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
890 struct qeth_card *card = dev->driver_data;
892 return qeth_dev_blkt_store(card, buf, count,
893 &card->info.blkt.inter_packet_jumbo,100);
896 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show,
897 qeth_dev_blkt_inter_jumbo_store);
899 static struct device_attribute * qeth_blkt_device_attrs[] = {
902 &dev_attr_inter_jumbo,
906 static struct attribute_group qeth_device_blkt_group = {
908 .attrs = (struct attribute **)qeth_blkt_device_attrs,
911 static struct device_attribute * qeth_device_attrs[] = {
918 &dev_attr_checksumming,
919 &dev_attr_priority_queueing,
920 &dev_attr_buffer_count,
922 #ifdef CONFIG_QETH_IPV6
927 &dev_attr_fake_broadcast,
929 &dev_attr_broadcast_mode,
930 &dev_attr_canonical_macaddr,
932 &dev_attr_large_send,
936 static struct attribute_group qeth_device_attr_group = {
937 .attrs = (struct attribute **)qeth_device_attrs,
940 static struct device_attribute * qeth_osn_device_attrs[] = {
945 &dev_attr_buffer_count,
950 static struct attribute_group qeth_osn_device_attr_group = {
951 .attrs = (struct attribute **)qeth_osn_device_attrs,
954 #define QETH_DEVICE_ATTR(_id,_name,_mode,_show,_store) \
955 struct device_attribute dev_attr_##_id = { \
956 .attr = {.name=__stringify(_name), .mode=_mode, .owner=THIS_MODULE },\
962 qeth_check_layer2(struct qeth_card *card)
964 if (card->options.layer2)
971 qeth_dev_ipato_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
973 struct qeth_card *card = dev->driver_data;
978 if (qeth_check_layer2(card))
980 return sprintf(buf, "%i\n", card->ipato.enabled? 1:0);
984 qeth_dev_ipato_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
986 struct qeth_card *card = dev->driver_data;
992 if ((card->state != CARD_STATE_DOWN) &&
993 (card->state != CARD_STATE_RECOVER))
996 if (qeth_check_layer2(card))
999 tmp = strsep((char **) &buf, "\n");
1000 if (!strcmp(tmp, "toggle")){
1001 card->ipato.enabled = (card->ipato.enabled)? 0 : 1;
1002 } else if (!strcmp(tmp, "1")){
1003 card->ipato.enabled = 1;
1004 } else if (!strcmp(tmp, "0")){
1005 card->ipato.enabled = 0;
1007 PRINT_WARN("ipato_enable: write 0, 1 or 'toggle' to "
1014 static QETH_DEVICE_ATTR(ipato_enable, enable, 0644,
1015 qeth_dev_ipato_enable_show,
1016 qeth_dev_ipato_enable_store);
1019 qeth_dev_ipato_invert4_show(struct device *dev, struct device_attribute *attr, char *buf)
1021 struct qeth_card *card = dev->driver_data;
1026 if (qeth_check_layer2(card))
1029 return sprintf(buf, "%i\n", card->ipato.invert4? 1:0);
1033 qeth_dev_ipato_invert4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1035 struct qeth_card *card = dev->driver_data;
1041 if (qeth_check_layer2(card))
1044 tmp = strsep((char **) &buf, "\n");
1045 if (!strcmp(tmp, "toggle")){
1046 card->ipato.invert4 = (card->ipato.invert4)? 0 : 1;
1047 } else if (!strcmp(tmp, "1")){
1048 card->ipato.invert4 = 1;
1049 } else if (!strcmp(tmp, "0")){
1050 card->ipato.invert4 = 0;
1052 PRINT_WARN("ipato_invert4: write 0, 1 or 'toggle' to "
1059 static QETH_DEVICE_ATTR(ipato_invert4, invert4, 0644,
1060 qeth_dev_ipato_invert4_show,
1061 qeth_dev_ipato_invert4_store);
1063 static inline ssize_t
1064 qeth_dev_ipato_add_show(char *buf, struct qeth_card *card,
1065 enum qeth_prot_versions proto)
1067 struct qeth_ipato_entry *ipatoe;
1068 unsigned long flags;
1070 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1073 if (qeth_check_layer2(card))
1076 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1077 /* add strlen for "/<mask>\n" */
1078 entry_len += (proto == QETH_PROT_IPV4)? 5 : 6;
1079 spin_lock_irqsave(&card->ip_lock, flags);
1080 list_for_each_entry(ipatoe, &card->ipato.entries, entry){
1081 if (ipatoe->proto != proto)
1083 /* String must not be longer than PAGE_SIZE. So we check if
1084 * string length gets near PAGE_SIZE. Then we can savely display
1085 * the next IPv6 address (worst case, compared to IPv4) */
1086 if ((PAGE_SIZE - i) <= entry_len)
1088 qeth_ipaddr_to_string(proto, ipatoe->addr, addr_str);
1089 i += snprintf(buf + i, PAGE_SIZE - i,
1090 "%s/%i\n", addr_str, ipatoe->mask_bits);
1092 spin_unlock_irqrestore(&card->ip_lock, flags);
1093 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1099 qeth_dev_ipato_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1101 struct qeth_card *card = dev->driver_data;
1106 return qeth_dev_ipato_add_show(buf, card, QETH_PROT_IPV4);
1110 qeth_parse_ipatoe(const char* buf, enum qeth_prot_versions proto,
1111 u8 *addr, int *mask_bits)
1113 const char *start, *end;
1115 char buffer[49] = {0, };
1118 /* get address string */
1119 end = strchr(start, '/');
1121 PRINT_WARN("Invalid format for ipato_addx/delx. "
1122 "Use <ip addr>/<mask bits>\n");
1125 strncpy(buffer, start, end - start);
1126 if (qeth_string_to_ipaddr(buffer, proto, addr)){
1127 PRINT_WARN("Invalid IP address format!\n");
1131 *mask_bits = simple_strtoul(start, &tmp, 10);
1136 static inline ssize_t
1137 qeth_dev_ipato_add_store(const char *buf, size_t count,
1138 struct qeth_card *card, enum qeth_prot_versions proto)
1140 struct qeth_ipato_entry *ipatoe;
1145 if (qeth_check_layer2(card))
1147 if ((rc = qeth_parse_ipatoe(buf, proto, addr, &mask_bits)))
1150 if (!(ipatoe = kmalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL))){
1151 PRINT_WARN("No memory to allocate ipato entry\n");
1154 memset(ipatoe, 0, sizeof(struct qeth_ipato_entry));
1155 ipatoe->proto = proto;
1156 memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4)? 4:16);
1157 ipatoe->mask_bits = mask_bits;
1159 if ((rc = qeth_add_ipato_entry(card, ipatoe))){
1168 qeth_dev_ipato_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1170 struct qeth_card *card = dev->driver_data;
1175 return qeth_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV4);
1178 static QETH_DEVICE_ATTR(ipato_add4, add4, 0644,
1179 qeth_dev_ipato_add4_show,
1180 qeth_dev_ipato_add4_store);
1182 static inline ssize_t
1183 qeth_dev_ipato_del_store(const char *buf, size_t count,
1184 struct qeth_card *card, enum qeth_prot_versions proto)
1190 if (qeth_check_layer2(card))
1192 if ((rc = qeth_parse_ipatoe(buf, proto, addr, &mask_bits)))
1195 qeth_del_ipato_entry(card, proto, addr, mask_bits);
1201 qeth_dev_ipato_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1203 struct qeth_card *card = dev->driver_data;
1208 return qeth_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV4);
1211 static QETH_DEVICE_ATTR(ipato_del4, del4, 0200, NULL,
1212 qeth_dev_ipato_del4_store);
1214 #ifdef CONFIG_QETH_IPV6
1216 qeth_dev_ipato_invert6_show(struct device *dev, struct device_attribute *attr, char *buf)
1218 struct qeth_card *card = dev->driver_data;
1223 if (qeth_check_layer2(card))
1226 return sprintf(buf, "%i\n", card->ipato.invert6? 1:0);
1230 qeth_dev_ipato_invert6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1232 struct qeth_card *card = dev->driver_data;
1238 if (qeth_check_layer2(card))
1241 tmp = strsep((char **) &buf, "\n");
1242 if (!strcmp(tmp, "toggle")){
1243 card->ipato.invert6 = (card->ipato.invert6)? 0 : 1;
1244 } else if (!strcmp(tmp, "1")){
1245 card->ipato.invert6 = 1;
1246 } else if (!strcmp(tmp, "0")){
1247 card->ipato.invert6 = 0;
1249 PRINT_WARN("ipato_invert6: write 0, 1 or 'toggle' to "
1256 static QETH_DEVICE_ATTR(ipato_invert6, invert6, 0644,
1257 qeth_dev_ipato_invert6_show,
1258 qeth_dev_ipato_invert6_store);
1262 qeth_dev_ipato_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1264 struct qeth_card *card = dev->driver_data;
1269 return qeth_dev_ipato_add_show(buf, card, QETH_PROT_IPV6);
1273 qeth_dev_ipato_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1275 struct qeth_card *card = dev->driver_data;
1280 return qeth_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV6);
1283 static QETH_DEVICE_ATTR(ipato_add6, add6, 0644,
1284 qeth_dev_ipato_add6_show,
1285 qeth_dev_ipato_add6_store);
1288 qeth_dev_ipato_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1290 struct qeth_card *card = dev->driver_data;
1295 return qeth_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV6);
1298 static QETH_DEVICE_ATTR(ipato_del6, del6, 0200, NULL,
1299 qeth_dev_ipato_del6_store);
1300 #endif /* CONFIG_QETH_IPV6 */
1302 static struct device_attribute * qeth_ipato_device_attrs[] = {
1303 &dev_attr_ipato_enable,
1304 &dev_attr_ipato_invert4,
1305 &dev_attr_ipato_add4,
1306 &dev_attr_ipato_del4,
1307 #ifdef CONFIG_QETH_IPV6
1308 &dev_attr_ipato_invert6,
1309 &dev_attr_ipato_add6,
1310 &dev_attr_ipato_del6,
1315 static struct attribute_group qeth_device_ipato_group = {
1316 .name = "ipa_takeover",
1317 .attrs = (struct attribute **)qeth_ipato_device_attrs,
1320 static inline ssize_t
1321 qeth_dev_vipa_add_show(char *buf, struct qeth_card *card,
1322 enum qeth_prot_versions proto)
1324 struct qeth_ipaddr *ipaddr;
1326 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1327 unsigned long flags;
1330 if (qeth_check_layer2(card))
1333 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1334 entry_len += 2; /* \n + terminator */
1335 spin_lock_irqsave(&card->ip_lock, flags);
1336 list_for_each_entry(ipaddr, &card->ip_list, entry){
1337 if (ipaddr->proto != proto)
1339 if (ipaddr->type != QETH_IP_TYPE_VIPA)
1341 /* String must not be longer than PAGE_SIZE. So we check if
1342 * string length gets near PAGE_SIZE. Then we can savely display
1343 * the next IPv6 address (worst case, compared to IPv4) */
1344 if ((PAGE_SIZE - i) <= entry_len)
1346 qeth_ipaddr_to_string(proto, (const u8 *)&ipaddr->u, addr_str);
1347 i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
1349 spin_unlock_irqrestore(&card->ip_lock, flags);
1350 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1356 qeth_dev_vipa_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1358 struct qeth_card *card = dev->driver_data;
1363 return qeth_dev_vipa_add_show(buf, card, QETH_PROT_IPV4);
1367 qeth_parse_vipae(const char* buf, enum qeth_prot_versions proto,
1370 if (qeth_string_to_ipaddr(buf, proto, addr)){
1371 PRINT_WARN("Invalid IP address format!\n");
1377 static inline ssize_t
1378 qeth_dev_vipa_add_store(const char *buf, size_t count,
1379 struct qeth_card *card, enum qeth_prot_versions proto)
1381 u8 addr[16] = {0, };
1384 if (qeth_check_layer2(card))
1386 if ((rc = qeth_parse_vipae(buf, proto, addr)))
1389 if ((rc = qeth_add_vipa(card, proto, addr)))
1396 qeth_dev_vipa_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1398 struct qeth_card *card = dev->driver_data;
1403 return qeth_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV4);
1406 static QETH_DEVICE_ATTR(vipa_add4, add4, 0644,
1407 qeth_dev_vipa_add4_show,
1408 qeth_dev_vipa_add4_store);
1410 static inline ssize_t
1411 qeth_dev_vipa_del_store(const char *buf, size_t count,
1412 struct qeth_card *card, enum qeth_prot_versions proto)
1417 if (qeth_check_layer2(card))
1419 if ((rc = qeth_parse_vipae(buf, proto, addr)))
1422 qeth_del_vipa(card, proto, addr);
1428 qeth_dev_vipa_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1430 struct qeth_card *card = dev->driver_data;
1435 return qeth_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV4);
1438 static QETH_DEVICE_ATTR(vipa_del4, del4, 0200, NULL,
1439 qeth_dev_vipa_del4_store);
1441 #ifdef CONFIG_QETH_IPV6
1443 qeth_dev_vipa_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1445 struct qeth_card *card = dev->driver_data;
1450 return qeth_dev_vipa_add_show(buf, card, QETH_PROT_IPV6);
1454 qeth_dev_vipa_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1456 struct qeth_card *card = dev->driver_data;
1461 return qeth_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV6);
1464 static QETH_DEVICE_ATTR(vipa_add6, add6, 0644,
1465 qeth_dev_vipa_add6_show,
1466 qeth_dev_vipa_add6_store);
1469 qeth_dev_vipa_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1471 struct qeth_card *card = dev->driver_data;
1476 if (qeth_check_layer2(card))
1479 return qeth_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV6);
1482 static QETH_DEVICE_ATTR(vipa_del6, del6, 0200, NULL,
1483 qeth_dev_vipa_del6_store);
1484 #endif /* CONFIG_QETH_IPV6 */
1486 static struct device_attribute * qeth_vipa_device_attrs[] = {
1487 &dev_attr_vipa_add4,
1488 &dev_attr_vipa_del4,
1489 #ifdef CONFIG_QETH_IPV6
1490 &dev_attr_vipa_add6,
1491 &dev_attr_vipa_del6,
1496 static struct attribute_group qeth_device_vipa_group = {
1498 .attrs = (struct attribute **)qeth_vipa_device_attrs,
1501 static inline ssize_t
1502 qeth_dev_rxip_add_show(char *buf, struct qeth_card *card,
1503 enum qeth_prot_versions proto)
1505 struct qeth_ipaddr *ipaddr;
1507 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1508 unsigned long flags;
1511 if (qeth_check_layer2(card))
1514 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1515 entry_len += 2; /* \n + terminator */
1516 spin_lock_irqsave(&card->ip_lock, flags);
1517 list_for_each_entry(ipaddr, &card->ip_list, entry){
1518 if (ipaddr->proto != proto)
1520 if (ipaddr->type != QETH_IP_TYPE_RXIP)
1522 /* String must not be longer than PAGE_SIZE. So we check if
1523 * string length gets near PAGE_SIZE. Then we can savely display
1524 * the next IPv6 address (worst case, compared to IPv4) */
1525 if ((PAGE_SIZE - i) <= entry_len)
1527 qeth_ipaddr_to_string(proto, (const u8 *)&ipaddr->u, addr_str);
1528 i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
1530 spin_unlock_irqrestore(&card->ip_lock, flags);
1531 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1537 qeth_dev_rxip_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1539 struct qeth_card *card = dev->driver_data;
1544 return qeth_dev_rxip_add_show(buf, card, QETH_PROT_IPV4);
1548 qeth_parse_rxipe(const char* buf, enum qeth_prot_versions proto,
1551 if (qeth_string_to_ipaddr(buf, proto, addr)){
1552 PRINT_WARN("Invalid IP address format!\n");
1558 static inline ssize_t
1559 qeth_dev_rxip_add_store(const char *buf, size_t count,
1560 struct qeth_card *card, enum qeth_prot_versions proto)
1562 u8 addr[16] = {0, };
1565 if (qeth_check_layer2(card))
1567 if ((rc = qeth_parse_rxipe(buf, proto, addr)))
1570 if ((rc = qeth_add_rxip(card, proto, addr)))
1577 qeth_dev_rxip_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1579 struct qeth_card *card = dev->driver_data;
1584 return qeth_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV4);
1587 static QETH_DEVICE_ATTR(rxip_add4, add4, 0644,
1588 qeth_dev_rxip_add4_show,
1589 qeth_dev_rxip_add4_store);
1591 static inline ssize_t
1592 qeth_dev_rxip_del_store(const char *buf, size_t count,
1593 struct qeth_card *card, enum qeth_prot_versions proto)
1598 if (qeth_check_layer2(card))
1600 if ((rc = qeth_parse_rxipe(buf, proto, addr)))
1603 qeth_del_rxip(card, proto, addr);
1609 qeth_dev_rxip_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1611 struct qeth_card *card = dev->driver_data;
1616 return qeth_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV4);
1619 static QETH_DEVICE_ATTR(rxip_del4, del4, 0200, NULL,
1620 qeth_dev_rxip_del4_store);
1622 #ifdef CONFIG_QETH_IPV6
1624 qeth_dev_rxip_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1626 struct qeth_card *card = dev->driver_data;
1631 return qeth_dev_rxip_add_show(buf, card, QETH_PROT_IPV6);
1635 qeth_dev_rxip_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1637 struct qeth_card *card = dev->driver_data;
1642 return qeth_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV6);
1645 static QETH_DEVICE_ATTR(rxip_add6, add6, 0644,
1646 qeth_dev_rxip_add6_show,
1647 qeth_dev_rxip_add6_store);
1650 qeth_dev_rxip_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1652 struct qeth_card *card = dev->driver_data;
1657 return qeth_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV6);
1660 static QETH_DEVICE_ATTR(rxip_del6, del6, 0200, NULL,
1661 qeth_dev_rxip_del6_store);
1662 #endif /* CONFIG_QETH_IPV6 */
1664 static struct device_attribute * qeth_rxip_device_attrs[] = {
1665 &dev_attr_rxip_add4,
1666 &dev_attr_rxip_del4,
1667 #ifdef CONFIG_QETH_IPV6
1668 &dev_attr_rxip_add6,
1669 &dev_attr_rxip_del6,
1674 static struct attribute_group qeth_device_rxip_group = {
1676 .attrs = (struct attribute **)qeth_rxip_device_attrs,
1680 qeth_create_device_attributes(struct device *dev)
1683 struct qeth_card *card = dev->driver_data;
1685 if (card->info.type == QETH_CARD_TYPE_OSN)
1686 return sysfs_create_group(&dev->kobj,
1687 &qeth_osn_device_attr_group);
1689 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group)))
1691 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){
1692 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1695 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_vipa_group))){
1696 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1697 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1700 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_rxip_group))){
1701 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1702 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1703 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
1705 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_blkt_group)))
1712 qeth_remove_device_attributes(struct device *dev)
1714 struct qeth_card *card = dev->driver_data;
1716 if (card->info.type == QETH_CARD_TYPE_OSN)
1717 return sysfs_remove_group(&dev->kobj,
1718 &qeth_osn_device_attr_group);
1720 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1721 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1722 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
1723 sysfs_remove_group(&dev->kobj, &qeth_device_rxip_group);
1724 sysfs_remove_group(&dev->kobj, &qeth_device_blkt_group);
1727 /**********************/
1728 /* DRIVER ATTRIBUTES */
1729 /**********************/
1731 qeth_driver_group_store(struct device_driver *ddrv, const char *buf,
1734 const char *start, *end;
1735 char bus_ids[3][BUS_ID_SIZE], *argv[3];
1740 for (i = 0; i < 3; i++) {
1741 static const char delim[] = { ',', ',', '\n' };
1744 if (!(end = strchr(start, delim[i])))
1746 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
1747 strncpy(bus_ids[i], start, len);
1748 bus_ids[i][len] = '\0';
1750 argv[i] = bus_ids[i];
1752 err = ccwgroup_create(qeth_root_dev, qeth_ccwgroup_driver.driver_id,
1753 &qeth_ccw_driver, 3, argv);
1761 static DRIVER_ATTR(group, 0200, 0, qeth_driver_group_store);
1764 qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
1771 tmp = strsep((char **) &buf, "\n");
1772 if (!strncmp(tmp, "unregister", 10)){
1773 if ((rc = qeth_notifier_unregister(current)))
1778 signum = simple_strtoul(tmp, &tmp2, 10);
1779 if ((signum < 0) || (signum > 32)){
1780 PRINT_WARN("Signal number %d is out of range\n", signum);
1783 if ((rc = qeth_notifier_register(current, signum)))
1789 static DRIVER_ATTR(notifier_register, 0200, 0,
1790 qeth_driver_notifier_register_store);
1793 qeth_create_driver_attributes(void)
1797 if ((rc = driver_create_file(&qeth_ccwgroup_driver.driver,
1798 &driver_attr_group)))
1800 return driver_create_file(&qeth_ccwgroup_driver.driver,
1801 &driver_attr_notifier_register);
1805 qeth_remove_driver_attributes(void)
1807 driver_remove_file(&qeth_ccwgroup_driver.driver,
1808 &driver_attr_group);
1809 driver_remove_file(&qeth_ccwgroup_driver.driver,
1810 &driver_attr_notifier_register);