3 * linux/drivers/s390/net/qeth_sys.c
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 <fpavlic@de.ibm.com>
14 #include <linux/list.h>
15 #include <linux/rwsem.h>
17 #include <asm/ebcdic.h>
23 /*****************************************************************************/
25 /* /sys-fs stuff UNDER DEVELOPMENT !!! */
27 /*****************************************************************************/
31 qeth_dev_state_show(struct device *dev, struct device_attribute *attr, char *buf)
33 struct qeth_card *card = dev->driver_data;
37 switch (card->state) {
39 return sprintf(buf, "DOWN\n");
40 case CARD_STATE_HARDSETUP:
41 return sprintf(buf, "HARDSETUP\n");
42 case CARD_STATE_SOFTSETUP:
43 return sprintf(buf, "SOFTSETUP\n");
46 return sprintf(buf, "UP (LAN ONLINE)\n");
48 return sprintf(buf, "UP (LAN OFFLINE)\n");
49 case CARD_STATE_RECOVER:
50 return sprintf(buf, "RECOVER\n");
52 return sprintf(buf, "UNKNOWN\n");
56 static DEVICE_ATTR(state, 0444, qeth_dev_state_show, NULL);
59 qeth_dev_chpid_show(struct device *dev, struct device_attribute *attr, char *buf)
61 struct qeth_card *card = dev->driver_data;
65 return sprintf(buf, "%02X\n", card->info.chpid);
68 static DEVICE_ATTR(chpid, 0444, qeth_dev_chpid_show, NULL);
71 qeth_dev_if_name_show(struct device *dev, struct device_attribute *attr, char *buf)
73 struct qeth_card *card = dev->driver_data;
76 return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card));
79 static DEVICE_ATTR(if_name, 0444, qeth_dev_if_name_show, NULL);
82 qeth_dev_card_type_show(struct device *dev, struct device_attribute *attr, char *buf)
84 struct qeth_card *card = dev->driver_data;
88 return sprintf(buf, "%s\n", qeth_get_cardname_short(card));
91 static DEVICE_ATTR(card_type, 0444, qeth_dev_card_type_show, NULL);
94 qeth_dev_portno_show(struct device *dev, struct device_attribute *attr, char *buf)
96 struct qeth_card *card = dev->driver_data;
100 return sprintf(buf, "%i\n", card->info.portno);
104 qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
106 struct qeth_card *card = dev->driver_data;
113 if ((card->state != CARD_STATE_DOWN) &&
114 (card->state != CARD_STATE_RECOVER))
117 portno = simple_strtoul(buf, &tmp, 16);
118 if (portno > MAX_PORTNO){
119 PRINT_WARN("portno 0x%X is out of range\n", portno);
123 card->info.portno = portno;
127 static DEVICE_ATTR(portno, 0644, qeth_dev_portno_show, qeth_dev_portno_store);
130 qeth_dev_portname_show(struct device *dev, struct device_attribute *attr, char *buf)
132 struct qeth_card *card = dev->driver_data;
133 char portname[9] = {0, };
138 if (card->info.portname_required) {
139 memcpy(portname, card->info.portname + 1, 8);
141 return sprintf(buf, "%s\n", portname);
143 return sprintf(buf, "no portname required\n");
147 qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
149 struct qeth_card *card = dev->driver_data;
156 if ((card->state != CARD_STATE_DOWN) &&
157 (card->state != CARD_STATE_RECOVER))
160 tmp = strsep((char **) &buf, "\n");
161 if ((strlen(tmp) > 8) || (strlen(tmp) == 0))
164 card->info.portname[0] = strlen(tmp);
165 /* for beauty reasons */
166 for (i = 1; i < 9; i++)
167 card->info.portname[i] = ' ';
168 strcpy(card->info.portname + 1, tmp);
169 ASCEBC(card->info.portname + 1, 8);
174 static DEVICE_ATTR(portname, 0644, qeth_dev_portname_show,
175 qeth_dev_portname_store);
178 qeth_dev_checksum_show(struct device *dev, struct device_attribute *attr, char *buf)
180 struct qeth_card *card = dev->driver_data;
185 return sprintf(buf, "%s checksumming\n", qeth_get_checksum_str(card));
189 qeth_dev_checksum_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
191 struct qeth_card *card = dev->driver_data;
197 if ((card->state != CARD_STATE_DOWN) &&
198 (card->state != CARD_STATE_RECOVER))
201 tmp = strsep((char **) &buf, "\n");
202 if (!strcmp(tmp, "sw_checksumming"))
203 card->options.checksum_type = SW_CHECKSUMMING;
204 else if (!strcmp(tmp, "hw_checksumming"))
205 card->options.checksum_type = HW_CHECKSUMMING;
206 else if (!strcmp(tmp, "no_checksumming"))
207 card->options.checksum_type = NO_CHECKSUMMING;
209 PRINT_WARN("Unknown checksumming type '%s'\n", tmp);
215 static DEVICE_ATTR(checksumming, 0644, qeth_dev_checksum_show,
216 qeth_dev_checksum_store);
219 qeth_dev_prioqing_show(struct device *dev, struct device_attribute *attr, char *buf)
221 struct qeth_card *card = dev->driver_data;
226 switch (card->qdio.do_prio_queueing) {
227 case QETH_PRIO_Q_ING_PREC:
228 return sprintf(buf, "%s\n", "by precedence");
229 case QETH_PRIO_Q_ING_TOS:
230 return sprintf(buf, "%s\n", "by type of service");
232 return sprintf(buf, "always queue %i\n",
233 card->qdio.default_out_queue);
238 qeth_dev_prioqing_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
240 struct qeth_card *card = dev->driver_data;
246 if ((card->state != CARD_STATE_DOWN) &&
247 (card->state != CARD_STATE_RECOVER))
250 /* check if 1920 devices are supported ,
251 * if though we have to permit priority queueing
253 if (card->qdio.no_out_queues == 1) {
254 PRINT_WARN("Priority queueing disabled due "
255 "to hardware limitations!\n");
256 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
260 tmp = strsep((char **) &buf, "\n");
261 if (!strcmp(tmp, "prio_queueing_prec"))
262 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC;
263 else if (!strcmp(tmp, "prio_queueing_tos"))
264 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS;
265 else if (!strcmp(tmp, "no_prio_queueing:0")) {
266 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
267 card->qdio.default_out_queue = 0;
268 } else if (!strcmp(tmp, "no_prio_queueing:1")) {
269 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
270 card->qdio.default_out_queue = 1;
271 } else if (!strcmp(tmp, "no_prio_queueing:2")) {
272 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
273 card->qdio.default_out_queue = 2;
274 } else if (!strcmp(tmp, "no_prio_queueing:3")) {
275 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
276 card->qdio.default_out_queue = 3;
277 } else if (!strcmp(tmp, "no_prio_queueing")) {
278 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
279 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
281 PRINT_WARN("Unknown queueing type '%s'\n", tmp);
287 static DEVICE_ATTR(priority_queueing, 0644, qeth_dev_prioqing_show,
288 qeth_dev_prioqing_store);
291 qeth_dev_bufcnt_show(struct device *dev, struct device_attribute *attr, char *buf)
293 struct qeth_card *card = dev->driver_data;
298 return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count);
302 qeth_dev_bufcnt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
304 struct qeth_card *card = dev->driver_data;
312 if ((card->state != CARD_STATE_DOWN) &&
313 (card->state != CARD_STATE_RECOVER))
316 old_cnt = card->qdio.in_buf_pool.buf_count;
317 cnt = simple_strtoul(buf, &tmp, 10);
318 cnt = (cnt < QETH_IN_BUF_COUNT_MIN) ? QETH_IN_BUF_COUNT_MIN :
319 ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
320 if (old_cnt != cnt) {
321 if ((rc = qeth_realloc_buffer_pool(card, cnt)))
322 PRINT_WARN("Error (%d) while setting "
323 "buffer count.\n", rc);
328 static DEVICE_ATTR(buffer_count, 0644, qeth_dev_bufcnt_show,
329 qeth_dev_bufcnt_store);
331 static inline ssize_t
332 qeth_dev_route_show(struct qeth_card *card, struct qeth_routing_info *route,
335 switch (route->type) {
337 return sprintf(buf, "%s\n", "primary router");
338 case SECONDARY_ROUTER:
339 return sprintf(buf, "%s\n", "secondary router");
340 case MULTICAST_ROUTER:
341 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
342 return sprintf(buf, "%s\n", "multicast router+");
344 return sprintf(buf, "%s\n", "multicast router");
345 case PRIMARY_CONNECTOR:
346 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
347 return sprintf(buf, "%s\n", "primary connector+");
349 return sprintf(buf, "%s\n", "primary connector");
350 case SECONDARY_CONNECTOR:
351 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO)
352 return sprintf(buf, "%s\n", "secondary connector+");
354 return sprintf(buf, "%s\n", "secondary connector");
356 return sprintf(buf, "%s\n", "no");
361 qeth_dev_route4_show(struct device *dev, struct device_attribute *attr, char *buf)
363 struct qeth_card *card = dev->driver_data;
368 return qeth_dev_route_show(card, &card->options.route4, buf);
371 static inline ssize_t
372 qeth_dev_route_store(struct qeth_card *card, struct qeth_routing_info *route,
373 enum qeth_prot_versions prot, const char *buf, size_t count)
375 enum qeth_routing_types old_route_type = route->type;
379 tmp = strsep((char **) &buf, "\n");
381 if (!strcmp(tmp, "no_router")){
382 route->type = NO_ROUTER;
383 } else if (!strcmp(tmp, "primary_connector")) {
384 route->type = PRIMARY_CONNECTOR;
385 } else if (!strcmp(tmp, "secondary_connector")) {
386 route->type = SECONDARY_CONNECTOR;
387 } else if (!strcmp(tmp, "multicast_router")) {
388 route->type = MULTICAST_ROUTER;
389 } else if (!strcmp(tmp, "primary_router")) {
390 route->type = PRIMARY_ROUTER;
391 } else if (!strcmp(tmp, "secondary_router")) {
392 route->type = SECONDARY_ROUTER;
393 } else if (!strcmp(tmp, "multicast_router")) {
394 route->type = MULTICAST_ROUTER;
396 PRINT_WARN("Invalid routing type '%s'.\n", tmp);
399 if (((card->state == CARD_STATE_SOFTSETUP) ||
400 (card->state == CARD_STATE_UP)) &&
401 (old_route_type != route->type)){
402 if (prot == QETH_PROT_IPV4)
403 rc = qeth_setrouting_v4(card);
404 else if (prot == QETH_PROT_IPV6)
405 rc = qeth_setrouting_v6(card);
411 qeth_dev_route4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
413 struct qeth_card *card = dev->driver_data;
418 return qeth_dev_route_store(card, &card->options.route4,
419 QETH_PROT_IPV4, buf, count);
422 static DEVICE_ATTR(route4, 0644, qeth_dev_route4_show, qeth_dev_route4_store);
424 #ifdef CONFIG_QETH_IPV6
426 qeth_dev_route6_show(struct device *dev, struct device_attribute *attr, char *buf)
428 struct qeth_card *card = dev->driver_data;
433 if (!qeth_is_supported(card, IPA_IPV6))
434 return sprintf(buf, "%s\n", "n/a");
436 return qeth_dev_route_show(card, &card->options.route6, buf);
440 qeth_dev_route6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
442 struct qeth_card *card = dev->driver_data;
447 if (!qeth_is_supported(card, IPA_IPV6)){
448 PRINT_WARN("IPv6 not supported for interface %s.\n"
449 "Routing status no changed.\n",
450 QETH_CARD_IFNAME(card));
454 return qeth_dev_route_store(card, &card->options.route6,
455 QETH_PROT_IPV6, buf, count);
458 static DEVICE_ATTR(route6, 0644, qeth_dev_route6_show, qeth_dev_route6_store);
462 qeth_dev_add_hhlen_show(struct device *dev, struct device_attribute *attr, char *buf)
464 struct qeth_card *card = dev->driver_data;
469 return sprintf(buf, "%i\n", card->options.add_hhlen);
473 qeth_dev_add_hhlen_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
475 struct qeth_card *card = dev->driver_data;
482 if ((card->state != CARD_STATE_DOWN) &&
483 (card->state != CARD_STATE_RECOVER))
486 i = simple_strtoul(buf, &tmp, 10);
487 if ((i < 0) || (i > MAX_ADD_HHLEN)) {
488 PRINT_WARN("add_hhlen out of range\n");
491 card->options.add_hhlen = i;
496 static DEVICE_ATTR(add_hhlen, 0644, qeth_dev_add_hhlen_show,
497 qeth_dev_add_hhlen_store);
500 qeth_dev_fake_ll_show(struct device *dev, struct device_attribute *attr, char *buf)
502 struct qeth_card *card = dev->driver_data;
507 return sprintf(buf, "%i\n", card->options.fake_ll? 1:0);
511 qeth_dev_fake_ll_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
513 struct qeth_card *card = dev->driver_data;
520 if ((card->state != CARD_STATE_DOWN) &&
521 (card->state != CARD_STATE_RECOVER))
524 i = simple_strtoul(buf, &tmp, 16);
525 if ((i != 0) && (i != 1)) {
526 PRINT_WARN("fake_ll: write 0 or 1 to this file!\n");
529 card->options.fake_ll = i;
533 static DEVICE_ATTR(fake_ll, 0644, qeth_dev_fake_ll_show,
534 qeth_dev_fake_ll_store);
537 qeth_dev_fake_broadcast_show(struct device *dev, struct device_attribute *attr, char *buf)
539 struct qeth_card *card = dev->driver_data;
544 return sprintf(buf, "%i\n", card->options.fake_broadcast? 1:0);
548 qeth_dev_fake_broadcast_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
550 struct qeth_card *card = dev->driver_data;
557 if ((card->state != CARD_STATE_DOWN) &&
558 (card->state != CARD_STATE_RECOVER))
561 i = simple_strtoul(buf, &tmp, 16);
562 if ((i == 0) || (i == 1))
563 card->options.fake_broadcast = i;
565 PRINT_WARN("fake_broadcast: write 0 or 1 to this file!\n");
571 static DEVICE_ATTR(fake_broadcast, 0644, qeth_dev_fake_broadcast_show,
572 qeth_dev_fake_broadcast_store);
575 qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
577 struct qeth_card *card = dev->driver_data;
584 if (card->state != CARD_STATE_UP)
587 i = simple_strtoul(buf, &tmp, 16);
589 qeth_schedule_recovery(card);
594 static DEVICE_ATTR(recover, 0200, NULL, qeth_dev_recover_store);
597 qeth_dev_broadcast_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
599 struct qeth_card *card = dev->driver_data;
604 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
605 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
606 return sprintf(buf, "n/a\n");
608 return sprintf(buf, "%s\n", (card->options.broadcast_mode ==
609 QETH_TR_BROADCAST_ALLRINGS)?
610 "all rings":"local");
614 qeth_dev_broadcast_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
616 struct qeth_card *card = dev->driver_data;
622 if ((card->state != CARD_STATE_DOWN) &&
623 (card->state != CARD_STATE_RECOVER))
626 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
627 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))){
628 PRINT_WARN("Device is not a tokenring device!\n");
632 tmp = strsep((char **) &buf, "\n");
634 if (!strcmp(tmp, "local")){
635 card->options.broadcast_mode = QETH_TR_BROADCAST_LOCAL;
637 } else if (!strcmp(tmp, "all_rings")) {
638 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
641 PRINT_WARN("broadcast_mode: invalid mode %s!\n",
648 static DEVICE_ATTR(broadcast_mode, 0644, qeth_dev_broadcast_mode_show,
649 qeth_dev_broadcast_mode_store);
652 qeth_dev_canonical_macaddr_show(struct device *dev, struct device_attribute *attr, char *buf)
654 struct qeth_card *card = dev->driver_data;
659 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
660 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
661 return sprintf(buf, "n/a\n");
663 return sprintf(buf, "%i\n", (card->options.macaddr_mode ==
664 QETH_TR_MACADDR_CANONICAL)? 1:0);
668 qeth_dev_canonical_macaddr_store(struct device *dev, struct device_attribute *attr, const char *buf,
671 struct qeth_card *card = dev->driver_data;
678 if ((card->state != CARD_STATE_DOWN) &&
679 (card->state != CARD_STATE_RECOVER))
682 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
683 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))){
684 PRINT_WARN("Device is not a tokenring device!\n");
688 i = simple_strtoul(buf, &tmp, 16);
689 if ((i == 0) || (i == 1))
690 card->options.macaddr_mode = i?
691 QETH_TR_MACADDR_CANONICAL :
692 QETH_TR_MACADDR_NONCANONICAL;
694 PRINT_WARN("canonical_macaddr: write 0 or 1 to this file!\n");
700 static DEVICE_ATTR(canonical_macaddr, 0644, qeth_dev_canonical_macaddr_show,
701 qeth_dev_canonical_macaddr_store);
704 qeth_dev_layer2_show(struct device *dev, struct device_attribute *attr, char *buf)
706 struct qeth_card *card = dev->driver_data;
711 return sprintf(buf, "%i\n", card->options.layer2 ? 1:0);
715 qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
717 struct qeth_card *card = dev->driver_data;
723 if (card->info.type == QETH_CARD_TYPE_IQD) {
724 PRINT_WARN("Layer2 on Hipersockets is not supported! \n");
728 if (((card->state != CARD_STATE_DOWN) &&
729 (card->state != CARD_STATE_RECOVER)))
732 i = simple_strtoul(buf, &tmp, 16);
733 if ((i == 0) || (i == 1))
734 card->options.layer2 = i;
736 PRINT_WARN("layer2: write 0 or 1 to this file!\n");
742 static DEVICE_ATTR(layer2, 0644, qeth_dev_layer2_show,
743 qeth_dev_layer2_store);
746 qeth_dev_large_send_show(struct device *dev, struct device_attribute *attr, char *buf)
748 struct qeth_card *card = dev->driver_data;
753 switch (card->options.large_send) {
754 case QETH_LARGE_SEND_NO:
755 return sprintf(buf, "%s\n", "no");
756 case QETH_LARGE_SEND_EDDP:
757 return sprintf(buf, "%s\n", "EDDP");
758 case QETH_LARGE_SEND_TSO:
759 return sprintf(buf, "%s\n", "TSO");
761 return sprintf(buf, "%s\n", "N/A");
766 qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
768 struct qeth_card *card = dev->driver_data;
769 enum qeth_large_send_types type;
775 tmp = strsep((char **) &buf, "\n");
776 if (!strcmp(tmp, "no")){
777 type = QETH_LARGE_SEND_NO;
778 } else if (!strcmp(tmp, "EDDP")) {
779 type = QETH_LARGE_SEND_EDDP;
780 } else if (!strcmp(tmp, "TSO")) {
781 type = QETH_LARGE_SEND_TSO;
783 PRINT_WARN("large_send: invalid mode %s!\n", tmp);
786 if (card->options.large_send == type)
788 if ((rc = qeth_set_large_send(card, type)))
793 static DEVICE_ATTR(large_send, 0644, qeth_dev_large_send_show,
794 qeth_dev_large_send_store);
797 qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value )
803 return sprintf(buf, "%i\n", value);
807 qeth_dev_blkt_store(struct qeth_card *card, const char *buf, size_t count,
808 int *value, int max_value)
816 if ((card->state != CARD_STATE_DOWN) &&
817 (card->state != CARD_STATE_RECOVER))
820 i = simple_strtoul(buf, &tmp, 10);
821 if (i <= max_value) {
824 PRINT_WARN("blkt total time: write values between"
825 " 0 and %d to this file!\n", max_value);
832 qeth_dev_blkt_total_show(struct device *dev, struct device_attribute *attr, char *buf)
834 struct qeth_card *card = dev->driver_data;
836 return qeth_dev_blkt_show(buf, card, card->info.blkt.time_total);
841 qeth_dev_blkt_total_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
843 struct qeth_card *card = dev->driver_data;
845 return qeth_dev_blkt_store(card, buf, count,
846 &card->info.blkt.time_total,1000);
851 static DEVICE_ATTR(total, 0644, qeth_dev_blkt_total_show,
852 qeth_dev_blkt_total_store);
855 qeth_dev_blkt_inter_show(struct device *dev, struct device_attribute *attr, char *buf)
857 struct qeth_card *card = dev->driver_data;
859 return qeth_dev_blkt_show(buf, card, card->info.blkt.inter_packet);
864 qeth_dev_blkt_inter_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
866 struct qeth_card *card = dev->driver_data;
868 return qeth_dev_blkt_store(card, buf, count,
869 &card->info.blkt.inter_packet,100);
872 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show,
873 qeth_dev_blkt_inter_store);
876 qeth_dev_blkt_inter_jumbo_show(struct device *dev, struct device_attribute *attr, char *buf)
878 struct qeth_card *card = dev->driver_data;
880 return qeth_dev_blkt_show(buf, card,
881 card->info.blkt.inter_packet_jumbo);
886 qeth_dev_blkt_inter_jumbo_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
888 struct qeth_card *card = dev->driver_data;
890 return qeth_dev_blkt_store(card, buf, count,
891 &card->info.blkt.inter_packet_jumbo,100);
894 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show,
895 qeth_dev_blkt_inter_jumbo_store);
897 static struct device_attribute * qeth_blkt_device_attrs[] = {
900 &dev_attr_inter_jumbo,
904 static struct attribute_group qeth_device_blkt_group = {
906 .attrs = (struct attribute **)qeth_blkt_device_attrs,
909 static struct device_attribute * qeth_device_attrs[] = {
916 &dev_attr_checksumming,
917 &dev_attr_priority_queueing,
918 &dev_attr_buffer_count,
920 #ifdef CONFIG_QETH_IPV6
925 &dev_attr_fake_broadcast,
927 &dev_attr_broadcast_mode,
928 &dev_attr_canonical_macaddr,
930 &dev_attr_large_send,
934 static struct attribute_group qeth_device_attr_group = {
935 .attrs = (struct attribute **)qeth_device_attrs,
938 static struct device_attribute * qeth_osn_device_attrs[] = {
943 &dev_attr_buffer_count,
948 static struct attribute_group qeth_osn_device_attr_group = {
949 .attrs = (struct attribute **)qeth_osn_device_attrs,
952 #define QETH_DEVICE_ATTR(_id,_name,_mode,_show,_store) \
953 struct device_attribute dev_attr_##_id = { \
954 .attr = {.name=__stringify(_name), .mode=_mode, .owner=THIS_MODULE },\
960 qeth_check_layer2(struct qeth_card *card)
962 if (card->options.layer2)
969 qeth_dev_ipato_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
971 struct qeth_card *card = dev->driver_data;
976 if (qeth_check_layer2(card))
978 return sprintf(buf, "%i\n", card->ipato.enabled? 1:0);
982 qeth_dev_ipato_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
984 struct qeth_card *card = dev->driver_data;
990 if ((card->state != CARD_STATE_DOWN) &&
991 (card->state != CARD_STATE_RECOVER))
994 if (qeth_check_layer2(card))
997 tmp = strsep((char **) &buf, "\n");
998 if (!strcmp(tmp, "toggle")){
999 card->ipato.enabled = (card->ipato.enabled)? 0 : 1;
1000 } else if (!strcmp(tmp, "1")){
1001 card->ipato.enabled = 1;
1002 } else if (!strcmp(tmp, "0")){
1003 card->ipato.enabled = 0;
1005 PRINT_WARN("ipato_enable: write 0, 1 or 'toggle' to "
1012 static QETH_DEVICE_ATTR(ipato_enable, enable, 0644,
1013 qeth_dev_ipato_enable_show,
1014 qeth_dev_ipato_enable_store);
1017 qeth_dev_ipato_invert4_show(struct device *dev, struct device_attribute *attr, char *buf)
1019 struct qeth_card *card = dev->driver_data;
1024 if (qeth_check_layer2(card))
1027 return sprintf(buf, "%i\n", card->ipato.invert4? 1:0);
1031 qeth_dev_ipato_invert4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1033 struct qeth_card *card = dev->driver_data;
1039 if (qeth_check_layer2(card))
1042 tmp = strsep((char **) &buf, "\n");
1043 if (!strcmp(tmp, "toggle")){
1044 card->ipato.invert4 = (card->ipato.invert4)? 0 : 1;
1045 } else if (!strcmp(tmp, "1")){
1046 card->ipato.invert4 = 1;
1047 } else if (!strcmp(tmp, "0")){
1048 card->ipato.invert4 = 0;
1050 PRINT_WARN("ipato_invert4: write 0, 1 or 'toggle' to "
1057 static QETH_DEVICE_ATTR(ipato_invert4, invert4, 0644,
1058 qeth_dev_ipato_invert4_show,
1059 qeth_dev_ipato_invert4_store);
1061 static inline ssize_t
1062 qeth_dev_ipato_add_show(char *buf, struct qeth_card *card,
1063 enum qeth_prot_versions proto)
1065 struct qeth_ipato_entry *ipatoe;
1066 unsigned long flags;
1068 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1071 if (qeth_check_layer2(card))
1074 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1075 /* add strlen for "/<mask>\n" */
1076 entry_len += (proto == QETH_PROT_IPV4)? 5 : 6;
1077 spin_lock_irqsave(&card->ip_lock, flags);
1078 list_for_each_entry(ipatoe, &card->ipato.entries, entry){
1079 if (ipatoe->proto != proto)
1081 /* String must not be longer than PAGE_SIZE. So we check if
1082 * string length gets near PAGE_SIZE. Then we can savely display
1083 * the next IPv6 address (worst case, compared to IPv4) */
1084 if ((PAGE_SIZE - i) <= entry_len)
1086 qeth_ipaddr_to_string(proto, ipatoe->addr, addr_str);
1087 i += snprintf(buf + i, PAGE_SIZE - i,
1088 "%s/%i\n", addr_str, ipatoe->mask_bits);
1090 spin_unlock_irqrestore(&card->ip_lock, flags);
1091 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1097 qeth_dev_ipato_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1099 struct qeth_card *card = dev->driver_data;
1104 return qeth_dev_ipato_add_show(buf, card, QETH_PROT_IPV4);
1108 qeth_parse_ipatoe(const char* buf, enum qeth_prot_versions proto,
1109 u8 *addr, int *mask_bits)
1111 const char *start, *end;
1113 char buffer[49] = {0, };
1116 /* get address string */
1117 end = strchr(start, '/');
1118 if (!end || (end-start >= 49)){
1119 PRINT_WARN("Invalid format for ipato_addx/delx. "
1120 "Use <ip addr>/<mask bits>\n");
1123 strncpy(buffer, start, end - start);
1124 if (qeth_string_to_ipaddr(buffer, proto, addr)){
1125 PRINT_WARN("Invalid IP address format!\n");
1129 *mask_bits = simple_strtoul(start, &tmp, 10);
1134 static inline ssize_t
1135 qeth_dev_ipato_add_store(const char *buf, size_t count,
1136 struct qeth_card *card, enum qeth_prot_versions proto)
1138 struct qeth_ipato_entry *ipatoe;
1143 if (qeth_check_layer2(card))
1145 if ((rc = qeth_parse_ipatoe(buf, proto, addr, &mask_bits)))
1148 if (!(ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL))){
1149 PRINT_WARN("No memory to allocate ipato entry\n");
1152 ipatoe->proto = proto;
1153 memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4)? 4:16);
1154 ipatoe->mask_bits = mask_bits;
1156 if ((rc = qeth_add_ipato_entry(card, ipatoe))){
1165 qeth_dev_ipato_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1167 struct qeth_card *card = dev->driver_data;
1172 return qeth_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV4);
1175 static QETH_DEVICE_ATTR(ipato_add4, add4, 0644,
1176 qeth_dev_ipato_add4_show,
1177 qeth_dev_ipato_add4_store);
1179 static inline ssize_t
1180 qeth_dev_ipato_del_store(const char *buf, size_t count,
1181 struct qeth_card *card, enum qeth_prot_versions proto)
1187 if (qeth_check_layer2(card))
1189 if ((rc = qeth_parse_ipatoe(buf, proto, addr, &mask_bits)))
1192 qeth_del_ipato_entry(card, proto, addr, mask_bits);
1198 qeth_dev_ipato_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1200 struct qeth_card *card = dev->driver_data;
1205 return qeth_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV4);
1208 static QETH_DEVICE_ATTR(ipato_del4, del4, 0200, NULL,
1209 qeth_dev_ipato_del4_store);
1211 #ifdef CONFIG_QETH_IPV6
1213 qeth_dev_ipato_invert6_show(struct device *dev, struct device_attribute *attr, char *buf)
1215 struct qeth_card *card = dev->driver_data;
1220 if (qeth_check_layer2(card))
1223 return sprintf(buf, "%i\n", card->ipato.invert6? 1:0);
1227 qeth_dev_ipato_invert6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1229 struct qeth_card *card = dev->driver_data;
1235 if (qeth_check_layer2(card))
1238 tmp = strsep((char **) &buf, "\n");
1239 if (!strcmp(tmp, "toggle")){
1240 card->ipato.invert6 = (card->ipato.invert6)? 0 : 1;
1241 } else if (!strcmp(tmp, "1")){
1242 card->ipato.invert6 = 1;
1243 } else if (!strcmp(tmp, "0")){
1244 card->ipato.invert6 = 0;
1246 PRINT_WARN("ipato_invert6: write 0, 1 or 'toggle' to "
1253 static QETH_DEVICE_ATTR(ipato_invert6, invert6, 0644,
1254 qeth_dev_ipato_invert6_show,
1255 qeth_dev_ipato_invert6_store);
1259 qeth_dev_ipato_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1261 struct qeth_card *card = dev->driver_data;
1266 return qeth_dev_ipato_add_show(buf, card, QETH_PROT_IPV6);
1270 qeth_dev_ipato_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1272 struct qeth_card *card = dev->driver_data;
1277 return qeth_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV6);
1280 static QETH_DEVICE_ATTR(ipato_add6, add6, 0644,
1281 qeth_dev_ipato_add6_show,
1282 qeth_dev_ipato_add6_store);
1285 qeth_dev_ipato_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1287 struct qeth_card *card = dev->driver_data;
1292 return qeth_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV6);
1295 static QETH_DEVICE_ATTR(ipato_del6, del6, 0200, NULL,
1296 qeth_dev_ipato_del6_store);
1297 #endif /* CONFIG_QETH_IPV6 */
1299 static struct device_attribute * qeth_ipato_device_attrs[] = {
1300 &dev_attr_ipato_enable,
1301 &dev_attr_ipato_invert4,
1302 &dev_attr_ipato_add4,
1303 &dev_attr_ipato_del4,
1304 #ifdef CONFIG_QETH_IPV6
1305 &dev_attr_ipato_invert6,
1306 &dev_attr_ipato_add6,
1307 &dev_attr_ipato_del6,
1312 static struct attribute_group qeth_device_ipato_group = {
1313 .name = "ipa_takeover",
1314 .attrs = (struct attribute **)qeth_ipato_device_attrs,
1317 static inline ssize_t
1318 qeth_dev_vipa_add_show(char *buf, struct qeth_card *card,
1319 enum qeth_prot_versions proto)
1321 struct qeth_ipaddr *ipaddr;
1323 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1324 unsigned long flags;
1327 if (qeth_check_layer2(card))
1330 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1331 entry_len += 2; /* \n + terminator */
1332 spin_lock_irqsave(&card->ip_lock, flags);
1333 list_for_each_entry(ipaddr, &card->ip_list, entry){
1334 if (ipaddr->proto != proto)
1336 if (ipaddr->type != QETH_IP_TYPE_VIPA)
1338 /* String must not be longer than PAGE_SIZE. So we check if
1339 * string length gets near PAGE_SIZE. Then we can savely display
1340 * the next IPv6 address (worst case, compared to IPv4) */
1341 if ((PAGE_SIZE - i) <= entry_len)
1343 qeth_ipaddr_to_string(proto, (const u8 *)&ipaddr->u, addr_str);
1344 i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
1346 spin_unlock_irqrestore(&card->ip_lock, flags);
1347 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1353 qeth_dev_vipa_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1355 struct qeth_card *card = dev->driver_data;
1360 return qeth_dev_vipa_add_show(buf, card, QETH_PROT_IPV4);
1364 qeth_parse_vipae(const char* buf, enum qeth_prot_versions proto,
1367 if (qeth_string_to_ipaddr(buf, proto, addr)){
1368 PRINT_WARN("Invalid IP address format!\n");
1374 static inline ssize_t
1375 qeth_dev_vipa_add_store(const char *buf, size_t count,
1376 struct qeth_card *card, enum qeth_prot_versions proto)
1378 u8 addr[16] = {0, };
1381 if (qeth_check_layer2(card))
1383 if ((rc = qeth_parse_vipae(buf, proto, addr)))
1386 if ((rc = qeth_add_vipa(card, proto, addr)))
1393 qeth_dev_vipa_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1395 struct qeth_card *card = dev->driver_data;
1400 return qeth_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV4);
1403 static QETH_DEVICE_ATTR(vipa_add4, add4, 0644,
1404 qeth_dev_vipa_add4_show,
1405 qeth_dev_vipa_add4_store);
1407 static inline ssize_t
1408 qeth_dev_vipa_del_store(const char *buf, size_t count,
1409 struct qeth_card *card, enum qeth_prot_versions proto)
1414 if (qeth_check_layer2(card))
1416 if ((rc = qeth_parse_vipae(buf, proto, addr)))
1419 qeth_del_vipa(card, proto, addr);
1425 qeth_dev_vipa_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1427 struct qeth_card *card = dev->driver_data;
1432 return qeth_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV4);
1435 static QETH_DEVICE_ATTR(vipa_del4, del4, 0200, NULL,
1436 qeth_dev_vipa_del4_store);
1438 #ifdef CONFIG_QETH_IPV6
1440 qeth_dev_vipa_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1442 struct qeth_card *card = dev->driver_data;
1447 return qeth_dev_vipa_add_show(buf, card, QETH_PROT_IPV6);
1451 qeth_dev_vipa_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1453 struct qeth_card *card = dev->driver_data;
1458 return qeth_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV6);
1461 static QETH_DEVICE_ATTR(vipa_add6, add6, 0644,
1462 qeth_dev_vipa_add6_show,
1463 qeth_dev_vipa_add6_store);
1466 qeth_dev_vipa_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1468 struct qeth_card *card = dev->driver_data;
1473 if (qeth_check_layer2(card))
1476 return qeth_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV6);
1479 static QETH_DEVICE_ATTR(vipa_del6, del6, 0200, NULL,
1480 qeth_dev_vipa_del6_store);
1481 #endif /* CONFIG_QETH_IPV6 */
1483 static struct device_attribute * qeth_vipa_device_attrs[] = {
1484 &dev_attr_vipa_add4,
1485 &dev_attr_vipa_del4,
1486 #ifdef CONFIG_QETH_IPV6
1487 &dev_attr_vipa_add6,
1488 &dev_attr_vipa_del6,
1493 static struct attribute_group qeth_device_vipa_group = {
1495 .attrs = (struct attribute **)qeth_vipa_device_attrs,
1498 static inline ssize_t
1499 qeth_dev_rxip_add_show(char *buf, struct qeth_card *card,
1500 enum qeth_prot_versions proto)
1502 struct qeth_ipaddr *ipaddr;
1504 int entry_len; /* length of 1 entry string, differs between v4 and v6 */
1505 unsigned long flags;
1508 if (qeth_check_layer2(card))
1511 entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
1512 entry_len += 2; /* \n + terminator */
1513 spin_lock_irqsave(&card->ip_lock, flags);
1514 list_for_each_entry(ipaddr, &card->ip_list, entry){
1515 if (ipaddr->proto != proto)
1517 if (ipaddr->type != QETH_IP_TYPE_RXIP)
1519 /* String must not be longer than PAGE_SIZE. So we check if
1520 * string length gets near PAGE_SIZE. Then we can savely display
1521 * the next IPv6 address (worst case, compared to IPv4) */
1522 if ((PAGE_SIZE - i) <= entry_len)
1524 qeth_ipaddr_to_string(proto, (const u8 *)&ipaddr->u, addr_str);
1525 i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
1527 spin_unlock_irqrestore(&card->ip_lock, flags);
1528 i += snprintf(buf + i, PAGE_SIZE - i, "\n");
1534 qeth_dev_rxip_add4_show(struct device *dev, struct device_attribute *attr, char *buf)
1536 struct qeth_card *card = dev->driver_data;
1541 return qeth_dev_rxip_add_show(buf, card, QETH_PROT_IPV4);
1545 qeth_parse_rxipe(const char* buf, enum qeth_prot_versions proto,
1548 if (qeth_string_to_ipaddr(buf, proto, addr)){
1549 PRINT_WARN("Invalid IP address format!\n");
1555 static inline ssize_t
1556 qeth_dev_rxip_add_store(const char *buf, size_t count,
1557 struct qeth_card *card, enum qeth_prot_versions proto)
1559 u8 addr[16] = {0, };
1562 if (qeth_check_layer2(card))
1564 if ((rc = qeth_parse_rxipe(buf, proto, addr)))
1567 if ((rc = qeth_add_rxip(card, proto, addr)))
1574 qeth_dev_rxip_add4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1576 struct qeth_card *card = dev->driver_data;
1581 return qeth_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV4);
1584 static QETH_DEVICE_ATTR(rxip_add4, add4, 0644,
1585 qeth_dev_rxip_add4_show,
1586 qeth_dev_rxip_add4_store);
1588 static inline ssize_t
1589 qeth_dev_rxip_del_store(const char *buf, size_t count,
1590 struct qeth_card *card, enum qeth_prot_versions proto)
1595 if (qeth_check_layer2(card))
1597 if ((rc = qeth_parse_rxipe(buf, proto, addr)))
1600 qeth_del_rxip(card, proto, addr);
1606 qeth_dev_rxip_del4_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1608 struct qeth_card *card = dev->driver_data;
1613 return qeth_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV4);
1616 static QETH_DEVICE_ATTR(rxip_del4, del4, 0200, NULL,
1617 qeth_dev_rxip_del4_store);
1619 #ifdef CONFIG_QETH_IPV6
1621 qeth_dev_rxip_add6_show(struct device *dev, struct device_attribute *attr, char *buf)
1623 struct qeth_card *card = dev->driver_data;
1628 return qeth_dev_rxip_add_show(buf, card, QETH_PROT_IPV6);
1632 qeth_dev_rxip_add6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1634 struct qeth_card *card = dev->driver_data;
1639 return qeth_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV6);
1642 static QETH_DEVICE_ATTR(rxip_add6, add6, 0644,
1643 qeth_dev_rxip_add6_show,
1644 qeth_dev_rxip_add6_store);
1647 qeth_dev_rxip_del6_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
1649 struct qeth_card *card = dev->driver_data;
1654 return qeth_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV6);
1657 static QETH_DEVICE_ATTR(rxip_del6, del6, 0200, NULL,
1658 qeth_dev_rxip_del6_store);
1659 #endif /* CONFIG_QETH_IPV6 */
1661 static struct device_attribute * qeth_rxip_device_attrs[] = {
1662 &dev_attr_rxip_add4,
1663 &dev_attr_rxip_del4,
1664 #ifdef CONFIG_QETH_IPV6
1665 &dev_attr_rxip_add6,
1666 &dev_attr_rxip_del6,
1671 static struct attribute_group qeth_device_rxip_group = {
1673 .attrs = (struct attribute **)qeth_rxip_device_attrs,
1677 qeth_create_device_attributes(struct device *dev)
1680 struct qeth_card *card = dev->driver_data;
1682 if (card->info.type == QETH_CARD_TYPE_OSN)
1683 return sysfs_create_group(&dev->kobj,
1684 &qeth_osn_device_attr_group);
1686 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group)))
1688 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){
1689 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1692 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_vipa_group))){
1693 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1694 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1697 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_rxip_group))){
1698 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1699 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1700 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
1702 if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_blkt_group)))
1709 qeth_remove_device_attributes(struct device *dev)
1711 struct qeth_card *card = dev->driver_data;
1713 if (card->info.type == QETH_CARD_TYPE_OSN)
1714 return sysfs_remove_group(&dev->kobj,
1715 &qeth_osn_device_attr_group);
1717 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1718 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1719 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
1720 sysfs_remove_group(&dev->kobj, &qeth_device_rxip_group);
1721 sysfs_remove_group(&dev->kobj, &qeth_device_blkt_group);
1724 /**********************/
1725 /* DRIVER ATTRIBUTES */
1726 /**********************/
1728 qeth_driver_group_store(struct device_driver *ddrv, const char *buf,
1731 const char *start, *end;
1732 char bus_ids[3][BUS_ID_SIZE], *argv[3];
1737 for (i = 0; i < 3; i++) {
1738 static const char delim[] = { ',', ',', '\n' };
1741 if (!(end = strchr(start, delim[i])))
1743 len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start);
1744 strncpy(bus_ids[i], start, len);
1745 bus_ids[i][len] = '\0';
1747 argv[i] = bus_ids[i];
1749 err = ccwgroup_create(qeth_root_dev, qeth_ccwgroup_driver.driver_id,
1750 &qeth_ccw_driver, 3, argv);
1758 static DRIVER_ATTR(group, 0200, NULL, qeth_driver_group_store);
1761 qeth_driver_notifier_register_store(struct device_driver *ddrv, const char *buf,
1768 tmp = strsep((char **) &buf, "\n");
1769 if (!strncmp(tmp, "unregister", 10)){
1770 if ((rc = qeth_notifier_unregister(current)))
1775 signum = simple_strtoul(tmp, &tmp2, 10);
1776 if ((signum < 0) || (signum > 32)){
1777 PRINT_WARN("Signal number %d is out of range\n", signum);
1780 if ((rc = qeth_notifier_register(current, signum)))
1786 static DRIVER_ATTR(notifier_register, 0200, NULL,
1787 qeth_driver_notifier_register_store);
1790 qeth_create_driver_attributes(void)
1794 if ((rc = driver_create_file(&qeth_ccwgroup_driver.driver,
1795 &driver_attr_group)))
1797 return driver_create_file(&qeth_ccwgroup_driver.driver,
1798 &driver_attr_notifier_register);
1802 qeth_remove_driver_attributes(void)
1804 driver_remove_file(&qeth_ccwgroup_driver.driver,
1805 &driver_attr_group);
1806 driver_remove_file(&qeth_ccwgroup_driver.driver,
1807 &driver_attr_notifier_register);