• Home
  • Raw
  • Download

Lines Matching refs:card

35 static void qeth_bridgeport_query_support(struct qeth_card *card);
36 static void qeth_bridge_state_change(struct qeth_card *card,
38 static void qeth_bridge_host_event(struct qeth_card *card,
43 struct qeth_card *card = dev->ml_priv; in qeth_l2_do_ioctl() local
47 if (!card) in qeth_l2_do_ioctl()
50 if (!qeth_card_hw_is_reachable(card)) in qeth_l2_do_ioctl()
53 if (card->info.type == QETH_CARD_TYPE_OSN) in qeth_l2_do_ioctl()
58 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data); in qeth_l2_do_ioctl()
61 if ((card->info.type == QETH_CARD_TYPE_OSD || in qeth_l2_do_ioctl()
62 card->info.type == QETH_CARD_TYPE_OSM || in qeth_l2_do_ioctl()
63 card->info.type == QETH_CARD_TYPE_OSX) && in qeth_l2_do_ioctl()
64 !card->info.guestlan) in qeth_l2_do_ioctl()
81 rc = qeth_query_oat_command(card, rq->ifr_ifru.ifru_data); in qeth_l2_do_ioctl()
87 QETH_CARD_TEXT_(card, 2, "ioce%d", rc); in qeth_l2_do_ioctl()
93 struct qeth_card *card; in qeth_l2_verify_dev() local
98 list_for_each_entry(card, &qeth_core_card_list.list, list) { in qeth_l2_verify_dev()
99 if (card->dev == dev) { in qeth_l2_verify_dev()
111 struct qeth_card *card; in qeth_l2_netdev_by_devno() local
120 list_for_each_entry(card, &qeth_core_card_list.list, list) { in qeth_l2_netdev_by_devno()
121 ccw_device_get_id(CARD_RDEV(card), &read_devid); in qeth_l2_netdev_by_devno()
123 ndev = card->dev; in qeth_l2_netdev_by_devno()
131 static int qeth_setdel_makerc(struct qeth_card *card, int retcode) in qeth_setdel_makerc() argument
136 QETH_CARD_TEXT_(card, 2, "err%04x", retcode); in qeth_setdel_makerc()
168 static int qeth_l2_send_setgroupmac(struct qeth_card *card, __u8 *mac) in qeth_l2_send_setgroupmac() argument
172 QETH_CARD_TEXT(card, 2, "L2Sgmac"); in qeth_l2_send_setgroupmac()
173 rc = qeth_setdel_makerc(card, qeth_l2_send_setdelmac(card, mac, in qeth_l2_send_setgroupmac()
177 mac, QETH_CARD_IFNAME(card)); in qeth_l2_send_setgroupmac()
180 mac, QETH_CARD_IFNAME(card), rc); in qeth_l2_send_setgroupmac()
184 static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac) in qeth_l2_send_delgroupmac() argument
188 QETH_CARD_TEXT(card, 2, "L2Dgmac"); in qeth_l2_send_delgroupmac()
189 rc = qeth_setdel_makerc(card, qeth_l2_send_setdelmac(card, mac, in qeth_l2_send_delgroupmac()
194 mac, QETH_CARD_IFNAME(card), rc); in qeth_l2_send_delgroupmac()
203 static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac) in qeth_l2_write_mac() argument
209 rc = qeth_setdel_makerc(card, in qeth_l2_write_mac()
210 qeth_l2_send_setdelmac(card, mac->mac_addr, in qeth_l2_write_mac()
213 rc = qeth_setdel_makerc(card, in qeth_l2_write_mac()
214 qeth_l2_send_setgroupmac(card, mac->mac_addr)); in qeth_l2_write_mac()
219 static void qeth_l2_del_all_macs(struct qeth_card *card, int del) in qeth_l2_del_all_macs() argument
225 spin_lock_bh(&card->mclock); in qeth_l2_del_all_macs()
226 hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { in qeth_l2_del_all_macs()
229 qeth_l2_send_setdelmac(card, mac->mac_addr, in qeth_l2_del_all_macs()
232 qeth_l2_send_delgroupmac(card, mac->mac_addr); in qeth_l2_del_all_macs()
237 spin_unlock_bh(&card->mclock); in qeth_l2_del_all_macs()
240 static inline int qeth_l2_get_cast_type(struct qeth_card *card, in qeth_l2_get_cast_type() argument
243 if (card->info.type == QETH_CARD_TYPE_OSN) in qeth_l2_get_cast_type()
252 static inline void qeth_l2_hdr_csum(struct qeth_card *card, in qeth_l2_hdr_csum() argument
265 if (card->options.performance_stats) in qeth_l2_hdr_csum()
266 card->perf_stats.tx_csum++; in qeth_l2_hdr_csum()
269 static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, in qeth_l2_fill_header() argument
295 static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card, in qeth_l2_send_setdelvlan_cb() argument
300 QETH_CARD_TEXT(card, 2, "L2sdvcb"); in qeth_l2_send_setdelvlan_cb()
305 QETH_CARD_IFNAME(card), cmd->hdr.return_code); in qeth_l2_send_setdelvlan_cb()
306 QETH_CARD_TEXT_(card, 2, "L2VL%4x", cmd->hdr.command); in qeth_l2_send_setdelvlan_cb()
307 QETH_CARD_TEXT_(card, 2, "err%d", cmd->hdr.return_code); in qeth_l2_send_setdelvlan_cb()
312 static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i, in qeth_l2_send_setdelvlan() argument
318 QETH_CARD_TEXT_(card, 4, "L2sdv%x", ipacmd); in qeth_l2_send_setdelvlan()
319 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); in qeth_l2_send_setdelvlan()
324 return qeth_send_ipa_cmd(card, iob, in qeth_l2_send_setdelvlan()
328 static void qeth_l2_process_vlans(struct qeth_card *card) in qeth_l2_process_vlans() argument
331 QETH_CARD_TEXT(card, 3, "L2prcvln"); in qeth_l2_process_vlans()
332 spin_lock_bh(&card->vlanlock); in qeth_l2_process_vlans()
333 list_for_each_entry(id, &card->vid_list, list) { in qeth_l2_process_vlans()
334 qeth_l2_send_setdelvlan(card, id->vid, IPA_CMD_SETVLAN); in qeth_l2_process_vlans()
336 spin_unlock_bh(&card->vlanlock); in qeth_l2_process_vlans()
342 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_add_vid() local
346 QETH_CARD_TEXT_(card, 4, "aid:%d", vid); in qeth_l2_vlan_rx_add_vid()
349 if (card->info.type == QETH_CARD_TYPE_OSM) { in qeth_l2_vlan_rx_add_vid()
350 QETH_CARD_TEXT(card, 3, "aidOSM"); in qeth_l2_vlan_rx_add_vid()
353 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l2_vlan_rx_add_vid()
354 QETH_CARD_TEXT(card, 3, "aidREC"); in qeth_l2_vlan_rx_add_vid()
360 rc = qeth_l2_send_setdelvlan(card, vid, IPA_CMD_SETVLAN); in qeth_l2_vlan_rx_add_vid()
365 spin_lock_bh(&card->vlanlock); in qeth_l2_vlan_rx_add_vid()
366 list_add_tail(&id->list, &card->vid_list); in qeth_l2_vlan_rx_add_vid()
367 spin_unlock_bh(&card->vlanlock); in qeth_l2_vlan_rx_add_vid()
378 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_kill_vid() local
381 QETH_CARD_TEXT_(card, 4, "kid:%d", vid); in qeth_l2_vlan_rx_kill_vid()
382 if (card->info.type == QETH_CARD_TYPE_OSM) { in qeth_l2_vlan_rx_kill_vid()
383 QETH_CARD_TEXT(card, 3, "kidOSM"); in qeth_l2_vlan_rx_kill_vid()
386 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l2_vlan_rx_kill_vid()
387 QETH_CARD_TEXT(card, 3, "kidREC"); in qeth_l2_vlan_rx_kill_vid()
390 spin_lock_bh(&card->vlanlock); in qeth_l2_vlan_rx_kill_vid()
391 list_for_each_entry(id, &card->vid_list, list) { in qeth_l2_vlan_rx_kill_vid()
398 spin_unlock_bh(&card->vlanlock); in qeth_l2_vlan_rx_kill_vid()
400 rc = qeth_l2_send_setdelvlan(card, vid, IPA_CMD_DELVLAN); in qeth_l2_vlan_rx_kill_vid()
403 qeth_l2_set_rx_mode(card->dev); in qeth_l2_vlan_rx_kill_vid()
407 static void qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) in qeth_l2_stop_card() argument
410 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); in qeth_l2_stop_card()
412 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_stop_card()
413 if (card->read.state == CH_STATE_UP && in qeth_l2_stop_card()
414 card->write.state == CH_STATE_UP && in qeth_l2_stop_card()
415 (card->state == CARD_STATE_UP)) { in qeth_l2_stop_card()
417 card->info.type != QETH_CARD_TYPE_OSN) { in qeth_l2_stop_card()
418 qeth_l2_stop(card->dev); in qeth_l2_stop_card()
421 dev_close(card->dev); in qeth_l2_stop_card()
424 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; in qeth_l2_stop_card()
425 card->state = CARD_STATE_SOFTSETUP; in qeth_l2_stop_card()
427 if (card->state == CARD_STATE_SOFTSETUP) { in qeth_l2_stop_card()
428 qeth_l2_del_all_macs(card, 0); in qeth_l2_stop_card()
429 qeth_clear_ipacmd_list(card); in qeth_l2_stop_card()
430 card->state = CARD_STATE_HARDSETUP; in qeth_l2_stop_card()
432 if (card->state == CARD_STATE_HARDSETUP) { in qeth_l2_stop_card()
433 qeth_qdio_clear_card(card, 0); in qeth_l2_stop_card()
434 qeth_clear_qdio_buffers(card); in qeth_l2_stop_card()
435 qeth_clear_working_pool_list(card); in qeth_l2_stop_card()
436 card->state = CARD_STATE_DOWN; in qeth_l2_stop_card()
438 if (card->state == CARD_STATE_DOWN) { in qeth_l2_stop_card()
439 qeth_clear_cmd_buffers(&card->read); in qeth_l2_stop_card()
440 qeth_clear_cmd_buffers(&card->write); in qeth_l2_stop_card()
444 static int qeth_l2_process_inbound_buffer(struct qeth_card *card, in qeth_l2_process_inbound_buffer() argument
455 skb = qeth_core_get_next_skb(card, in qeth_l2_process_inbound_buffer()
456 &card->qdio.in_q->bufs[card->rx.b_index], in qeth_l2_process_inbound_buffer()
457 &card->rx.b_element, &card->rx.e_offset, &hdr); in qeth_l2_process_inbound_buffer()
462 skb->dev = card->dev; in qeth_l2_process_inbound_buffer()
467 if ((card->dev->features & NETIF_F_RXCSUM) in qeth_l2_process_inbound_buffer()
477 *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno; in qeth_l2_process_inbound_buffer()
479 napi_gro_receive(&card->napi, skb); in qeth_l2_process_inbound_buffer()
482 if (card->info.type == QETH_CARD_TYPE_OSN) { in qeth_l2_process_inbound_buffer()
487 card->osn_info.data_cb(skb); in qeth_l2_process_inbound_buffer()
493 QETH_CARD_TEXT(card, 3, "inbunkno"); in qeth_l2_process_inbound_buffer()
499 card->stats.rx_packets++; in qeth_l2_process_inbound_buffer()
500 card->stats.rx_bytes += len; in qeth_l2_process_inbound_buffer()
507 struct qeth_card *card = container_of(napi, struct qeth_card, napi); in qeth_l2_poll() local
513 if (card->options.performance_stats) { in qeth_l2_poll()
514 card->perf_stats.inbound_cnt++; in qeth_l2_poll()
515 card->perf_stats.inbound_start_time = qeth_get_micros(); in qeth_l2_poll()
519 if (!card->rx.b_count) { in qeth_l2_poll()
520 card->rx.qdio_err = 0; in qeth_l2_poll()
521 card->rx.b_count = qdio_get_next_buffers( in qeth_l2_poll()
522 card->data.ccwdev, 0, &card->rx.b_index, in qeth_l2_poll()
523 &card->rx.qdio_err); in qeth_l2_poll()
524 if (card->rx.b_count <= 0) { in qeth_l2_poll()
525 card->rx.b_count = 0; in qeth_l2_poll()
528 card->rx.b_element = in qeth_l2_poll()
529 &card->qdio.in_q->bufs[card->rx.b_index] in qeth_l2_poll()
531 card->rx.e_offset = 0; in qeth_l2_poll()
534 while (card->rx.b_count) { in qeth_l2_poll()
535 buffer = &card->qdio.in_q->bufs[card->rx.b_index]; in qeth_l2_poll()
536 if (!(card->rx.qdio_err && in qeth_l2_poll()
537 qeth_check_qdio_errors(card, buffer->buffer, in qeth_l2_poll()
538 card->rx.qdio_err, "qinerr"))) in qeth_l2_poll()
540 card, new_budget, &done); in qeth_l2_poll()
545 if (card->options.performance_stats) in qeth_l2_poll()
546 card->perf_stats.bufs_rec++; in qeth_l2_poll()
547 qeth_put_buffer_pool_entry(card, in qeth_l2_poll()
549 qeth_queue_input_buffer(card, card->rx.b_index); in qeth_l2_poll()
550 card->rx.b_count--; in qeth_l2_poll()
551 if (card->rx.b_count) { in qeth_l2_poll()
552 card->rx.b_index = in qeth_l2_poll()
553 (card->rx.b_index + 1) % in qeth_l2_poll()
555 card->rx.b_element = in qeth_l2_poll()
556 &card->qdio.in_q in qeth_l2_poll()
557 ->bufs[card->rx.b_index] in qeth_l2_poll()
559 card->rx.e_offset = 0; in qeth_l2_poll()
571 if (qdio_start_irq(card->data.ccwdev, 0)) in qeth_l2_poll()
572 napi_schedule(&card->napi); in qeth_l2_poll()
574 if (card->options.performance_stats) in qeth_l2_poll()
575 card->perf_stats.inbound_time += qeth_get_micros() - in qeth_l2_poll()
576 card->perf_stats.inbound_start_time; in qeth_l2_poll()
580 static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac, in qeth_l2_send_setdelmac() argument
586 QETH_CARD_TEXT(card, 2, "L2sdmac"); in qeth_l2_send_setdelmac()
587 iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); in qeth_l2_send_setdelmac()
593 return qeth_send_ipa_cmd(card, iob, NULL, NULL); in qeth_l2_send_setdelmac()
596 static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) in qeth_l2_send_setmac() argument
600 QETH_CARD_TEXT(card, 2, "L2Setmac"); in qeth_l2_send_setmac()
601 rc = qeth_setdel_makerc(card, qeth_l2_send_setdelmac(card, mac, in qeth_l2_send_setmac()
604 card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; in qeth_l2_send_setmac()
605 memcpy(card->dev->dev_addr, mac, OSA_ADDR_LEN); in qeth_l2_send_setmac()
606 dev_info(&card->gdev->dev, in qeth_l2_send_setmac()
608 card->dev->dev_addr, card->dev->name); in qeth_l2_send_setmac()
610 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; in qeth_l2_send_setmac()
613 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
617 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
625 static int qeth_l2_send_delmac(struct qeth_card *card, __u8 *mac) in qeth_l2_send_delmac() argument
629 QETH_CARD_TEXT(card, 2, "L2Delmac"); in qeth_l2_send_delmac()
630 if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) in qeth_l2_send_delmac()
632 rc = qeth_setdel_makerc(card, qeth_l2_send_setdelmac(card, mac, in qeth_l2_send_delmac()
635 card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; in qeth_l2_send_delmac()
639 static int qeth_l2_request_initial_mac(struct qeth_card *card) in qeth_l2_request_initial_mac() argument
645 QETH_DBF_TEXT_(SETUP, 2, "doL2%s", CARD_BUS_ID(card)); in qeth_l2_request_initial_mac()
647 if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) { in qeth_l2_request_initial_mac()
648 rc = qeth_query_setadapterparms(card); in qeth_l2_request_initial_mac()
652 CARD_BUS_ID(card), rc); in qeth_l2_request_initial_mac()
656 if (card->info.type == QETH_CARD_TYPE_IQD || in qeth_l2_request_initial_mac()
657 card->info.type == QETH_CARD_TYPE_OSM || in qeth_l2_request_initial_mac()
658 card->info.type == QETH_CARD_TYPE_OSX || in qeth_l2_request_initial_mac()
659 card->info.guestlan) { in qeth_l2_request_initial_mac()
660 rc = qeth_setadpparms_change_macaddr(card); in qeth_l2_request_initial_mac()
663 "device %s: x%x\n", CARD_BUS_ID(card), rc); in qeth_l2_request_initial_mac()
667 QETH_DBF_HEX(SETUP, 2, card->dev->dev_addr, OSA_ADDR_LEN); in qeth_l2_request_initial_mac()
669 eth_random_addr(card->dev->dev_addr); in qeth_l2_request_initial_mac()
670 memcpy(card->dev->dev_addr, vendor_pre, 3); in qeth_l2_request_initial_mac()
678 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_mac_address() local
681 QETH_CARD_TEXT(card, 3, "setmac"); in qeth_l2_set_mac_address()
684 QETH_CARD_TEXT(card, 3, "setmcINV"); in qeth_l2_set_mac_address()
688 if (card->info.type == QETH_CARD_TYPE_OSN || in qeth_l2_set_mac_address()
689 card->info.type == QETH_CARD_TYPE_OSM || in qeth_l2_set_mac_address()
690 card->info.type == QETH_CARD_TYPE_OSX) { in qeth_l2_set_mac_address()
691 QETH_CARD_TEXT(card, 3, "setmcTYP"); in qeth_l2_set_mac_address()
694 QETH_CARD_HEX(card, 3, addr->sa_data, OSA_ADDR_LEN); in qeth_l2_set_mac_address()
695 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l2_set_mac_address()
696 QETH_CARD_TEXT(card, 3, "setmcREC"); in qeth_l2_set_mac_address()
699 rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]); in qeth_l2_set_mac_address()
701 rc = qeth_l2_send_setmac(card, addr->sa_data); in qeth_l2_set_mac_address()
705 static void qeth_promisc_to_bridge(struct qeth_card *card) in qeth_promisc_to_bridge() argument
707 struct net_device *dev = card->dev; in qeth_promisc_to_bridge()
712 QETH_CARD_TEXT(card, 3, "pmisc2br"); in qeth_promisc_to_bridge()
714 if (!card->options.sbp.reflect_promisc) in qeth_promisc_to_bridge()
718 if (promisc_mode == card->info.promisc_mode) in qeth_promisc_to_bridge()
722 if (card->options.sbp.reflect_promisc_primary) in qeth_promisc_to_bridge()
729 rc = qeth_bridgeport_setrole(card, role); in qeth_promisc_to_bridge()
733 card->options.sbp.role = role; in qeth_promisc_to_bridge()
734 card->info.promisc_mode = promisc_mode; in qeth_promisc_to_bridge()
743 qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha, u8 is_uc) in qeth_l2_add_mac() argument
747 hash_for_each_possible(card->mac_htable, mac, hnode, in qeth_l2_add_mac()
765 hash_add(card->mac_htable, &mac->hnode, in qeth_l2_add_mac()
772 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_rx_mode() local
779 if (card->info.type == QETH_CARD_TYPE_OSN) in qeth_l2_set_rx_mode()
782 QETH_CARD_TEXT(card, 3, "setmulti"); in qeth_l2_set_rx_mode()
783 if (qeth_threads_running(card, QETH_RECOVER_THREAD) && in qeth_l2_set_rx_mode()
784 (card->state != CARD_STATE_UP)) in qeth_l2_set_rx_mode()
787 spin_lock_bh(&card->mclock); in qeth_l2_set_rx_mode()
790 qeth_l2_add_mac(card, ha, 0); in qeth_l2_set_rx_mode()
793 qeth_l2_add_mac(card, ha, 1); in qeth_l2_set_rx_mode()
795 hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { in qeth_l2_set_rx_mode()
798 rc = qeth_l2_send_delgroupmac(card, in qeth_l2_set_rx_mode()
801 rc = qeth_l2_send_setdelmac(card, mac->mac_addr, in qeth_l2_set_rx_mode()
809 rc = qeth_l2_write_mac(card, mac); in qeth_l2_set_rx_mode()
819 spin_unlock_bh(&card->mclock); in qeth_l2_set_rx_mode()
821 if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) in qeth_l2_set_rx_mode()
822 qeth_setadp_promisc_mode(card); in qeth_l2_set_rx_mode()
824 qeth_promisc_to_bridge(card); in qeth_l2_set_rx_mode()
832 struct qeth_card *card = dev->ml_priv; in qeth_l2_hard_start_xmit() local
834 int cast_type = qeth_l2_get_cast_type(card, skb); in qeth_l2_hard_start_xmit()
842 if (card->qdio.do_prio_queueing || (cast_type && in qeth_l2_hard_start_xmit()
843 card->info.is_multicast_different)) in qeth_l2_hard_start_xmit()
844 queue = card->qdio.out_qs[qeth_get_priority_queue(card, skb, in qeth_l2_hard_start_xmit()
847 queue = card->qdio.out_qs[card->qdio.default_out_queue]; in qeth_l2_hard_start_xmit()
849 if ((card->state != CARD_STATE_UP) || !card->lan_online) { in qeth_l2_hard_start_xmit()
850 card->stats.tx_carrier_errors++; in qeth_l2_hard_start_xmit()
854 if ((card->info.type == QETH_CARD_TYPE_OSN) && in qeth_l2_hard_start_xmit()
858 if (card->options.performance_stats) { in qeth_l2_hard_start_xmit()
859 card->perf_stats.outbound_cnt++; in qeth_l2_hard_start_xmit()
860 card->perf_stats.outbound_start_time = qeth_get_micros(); in qeth_l2_hard_start_xmit()
867 if ((card->info.type != QETH_CARD_TYPE_IQD) && in qeth_l2_hard_start_xmit()
868 !qeth_get_elements_no(card, new_skb, 0, 0)) { in qeth_l2_hard_start_xmit()
871 if (card->options.performance_stats) { in qeth_l2_hard_start_xmit()
873 card->perf_stats.tx_linfail++; in qeth_l2_hard_start_xmit()
875 card->perf_stats.tx_lin++; in qeth_l2_hard_start_xmit()
881 if (card->info.type == QETH_CARD_TYPE_OSN) in qeth_l2_hard_start_xmit()
884 if (card->info.type == QETH_CARD_TYPE_IQD) { in qeth_l2_hard_start_xmit()
894 qeth_l2_fill_header(card, hdr, new_skb, cast_type); in qeth_l2_hard_start_xmit()
907 qeth_l2_fill_header(card, hdr, new_skb, cast_type); in qeth_l2_hard_start_xmit()
909 qeth_l2_hdr_csum(card, hdr, new_skb); in qeth_l2_hard_start_xmit()
913 elements = qeth_get_elements_no(card, new_skb, elements_needed, in qeth_l2_hard_start_xmit()
921 if (card->info.type != QETH_CARD_TYPE_IQD) { in qeth_l2_hard_start_xmit()
925 rc = qeth_do_send_packet(card, queue, new_skb, hdr, in qeth_l2_hard_start_xmit()
928 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr, in qeth_l2_hard_start_xmit()
931 card->stats.tx_packets++; in qeth_l2_hard_start_xmit()
932 card->stats.tx_bytes += tx_bytes; in qeth_l2_hard_start_xmit()
933 if (card->options.performance_stats) { in qeth_l2_hard_start_xmit()
936 card->perf_stats.sg_skbs_sent++; in qeth_l2_hard_start_xmit()
938 card->perf_stats.sg_frags_sent += nr_frags + 1; in qeth_l2_hard_start_xmit()
957 if (card->options.performance_stats) in qeth_l2_hard_start_xmit()
958 card->perf_stats.outbound_time += qeth_get_micros() - in qeth_l2_hard_start_xmit()
959 card->perf_stats.outbound_start_time; in qeth_l2_hard_start_xmit()
963 card->stats.tx_dropped++; in qeth_l2_hard_start_xmit()
964 card->stats.tx_errors++; in qeth_l2_hard_start_xmit()
974 struct qeth_card *card = dev->ml_priv; in __qeth_l2_open() local
977 QETH_CARD_TEXT(card, 4, "qethopen"); in __qeth_l2_open()
978 if (card->state == CARD_STATE_UP) in __qeth_l2_open()
980 if (card->state != CARD_STATE_SOFTSETUP) in __qeth_l2_open()
983 if ((card->info.type != QETH_CARD_TYPE_OSN) && in __qeth_l2_open()
984 (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) { in __qeth_l2_open()
985 QETH_CARD_TEXT(card, 4, "nomacadr"); in __qeth_l2_open()
988 card->data.state = CH_STATE_UP; in __qeth_l2_open()
989 card->state = CARD_STATE_UP; in __qeth_l2_open()
992 if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { in __qeth_l2_open()
993 napi_enable(&card->napi); in __qeth_l2_open()
994 napi_schedule(&card->napi); in __qeth_l2_open()
1002 struct qeth_card *card = dev->ml_priv; in qeth_l2_open() local
1004 QETH_CARD_TEXT(card, 5, "qethope_"); in qeth_l2_open()
1005 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l2_open()
1006 QETH_CARD_TEXT(card, 3, "openREC"); in qeth_l2_open()
1014 struct qeth_card *card = dev->ml_priv; in qeth_l2_stop() local
1016 QETH_CARD_TEXT(card, 4, "qethstop"); in qeth_l2_stop()
1018 if (card->state == CARD_STATE_UP) { in qeth_l2_stop()
1019 card->state = CARD_STATE_SOFTSETUP; in qeth_l2_stop()
1020 napi_disable(&card->napi); in qeth_l2_stop()
1032 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_probe_device() local
1040 INIT_LIST_HEAD(&card->vid_list); in qeth_l2_probe_device()
1041 hash_init(card->mac_htable); in qeth_l2_probe_device()
1042 card->options.layer2 = 1; in qeth_l2_probe_device()
1043 card->info.hwtrap = 0; in qeth_l2_probe_device()
1049 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); in qeth_l2_remove_device() local
1053 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_remove_device()
1054 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l2_remove_device()
1059 if (card->dev) { in qeth_l2_remove_device()
1060 unregister_netdev(card->dev); in qeth_l2_remove_device()
1061 free_netdev(card->dev); in qeth_l2_remove_device()
1062 card->dev = NULL; in qeth_l2_remove_device()
1101 static int qeth_l2_setup_netdev(struct qeth_card *card) in qeth_l2_setup_netdev() argument
1103 switch (card->info.type) { in qeth_l2_setup_netdev()
1105 card->dev = alloc_netdev(0, "hsi%d", NET_NAME_UNKNOWN, in qeth_l2_setup_netdev()
1109 card->dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN, in qeth_l2_setup_netdev()
1113 card->dev = alloc_etherdev(0); in qeth_l2_setup_netdev()
1116 if (!card->dev) in qeth_l2_setup_netdev()
1119 card->dev->ml_priv = card; in qeth_l2_setup_netdev()
1120 card->dev->watchdog_timeo = QETH_TX_TIMEOUT; in qeth_l2_setup_netdev()
1121 card->dev->mtu = card->info.initial_mtu; in qeth_l2_setup_netdev()
1122 card->dev->netdev_ops = &qeth_l2_netdev_ops; in qeth_l2_setup_netdev()
1123 if (card->info.type == QETH_CARD_TYPE_OSN) { in qeth_l2_setup_netdev()
1124 card->dev->ethtool_ops = &qeth_l2_osn_ops; in qeth_l2_setup_netdev()
1125 card->dev->flags |= IFF_NOARP; in qeth_l2_setup_netdev()
1127 card->dev->ethtool_ops = &qeth_l2_ethtool_ops; in qeth_l2_setup_netdev()
1129 card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; in qeth_l2_setup_netdev()
1130 if (card->info.type == QETH_CARD_TYPE_OSD && !card->info.guestlan) { in qeth_l2_setup_netdev()
1131 card->dev->hw_features = NETIF_F_SG; in qeth_l2_setup_netdev()
1132 card->dev->vlan_features = NETIF_F_SG; in qeth_l2_setup_netdev()
1133 card->dev->features |= NETIF_F_SG; in qeth_l2_setup_netdev()
1135 if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) { in qeth_l2_setup_netdev()
1136 card->dev->hw_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
1137 card->dev->vlan_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
1139 if (qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) { in qeth_l2_setup_netdev()
1140 card->dev->hw_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
1141 card->dev->vlan_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
1144 card->info.broadcast_capable = 1; in qeth_l2_setup_netdev()
1145 qeth_l2_request_initial_mac(card); in qeth_l2_setup_netdev()
1146 SET_NETDEV_DEV(card->dev, &card->gdev->dev); in qeth_l2_setup_netdev()
1147 netif_napi_add(card->dev, &card->napi, qeth_l2_poll, QETH_NAPI_WEIGHT); in qeth_l2_setup_netdev()
1148 netif_carrier_off(card->dev); in qeth_l2_setup_netdev()
1149 return register_netdev(card->dev); in qeth_l2_setup_netdev()
1152 static int qeth_l2_start_ipassists(struct qeth_card *card) in qeth_l2_start_ipassists() argument
1155 if (qeth_set_access_ctrl_online(card, 0)) in qeth_l2_start_ipassists()
1162 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in __qeth_l2_set_online() local
1166 mutex_lock(&card->discipline_mutex); in __qeth_l2_set_online()
1167 mutex_lock(&card->conf_mutex); in __qeth_l2_set_online()
1169 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); in __qeth_l2_set_online()
1171 recover_flag = card->state; in __qeth_l2_set_online()
1172 rc = qeth_core_hardsetup_card(card); in __qeth_l2_set_online()
1178 qeth_bridgeport_query_support(card); in __qeth_l2_set_online()
1179 if (card->options.sbp.supported_funcs) in __qeth_l2_set_online()
1180 dev_info(&card->gdev->dev, in __qeth_l2_set_online()
1182 qeth_trace_features(card); in __qeth_l2_set_online()
1184 if (!card->dev && qeth_l2_setup_netdev(card)) { in __qeth_l2_set_online()
1189 if (card->info.type != QETH_CARD_TYPE_OSN) in __qeth_l2_set_online()
1190 qeth_l2_send_setmac(card, &card->dev->dev_addr[0]); in __qeth_l2_set_online()
1192 if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) { in __qeth_l2_set_online()
1193 if (card->info.hwtrap && in __qeth_l2_set_online()
1194 qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM)) in __qeth_l2_set_online()
1195 card->info.hwtrap = 0; in __qeth_l2_set_online()
1197 card->info.hwtrap = 0; in __qeth_l2_set_online()
1199 qeth_l2_setup_bridgeport_attrs(card); in __qeth_l2_set_online()
1201 card->state = CARD_STATE_HARDSETUP; in __qeth_l2_set_online()
1202 memset(&card->rx, 0, sizeof(struct qeth_rx)); in __qeth_l2_set_online()
1203 qeth_print_status_message(card); in __qeth_l2_set_online()
1208 if ((card->info.type == QETH_CARD_TYPE_OSD) || in __qeth_l2_set_online()
1209 (card->info.type == QETH_CARD_TYPE_OSX)) { in __qeth_l2_set_online()
1210 rc = qeth_l2_start_ipassists(card); in __qeth_l2_set_online()
1215 if (card->info.type != QETH_CARD_TYPE_OSN && in __qeth_l2_set_online()
1216 card->info.type != QETH_CARD_TYPE_OSM) in __qeth_l2_set_online()
1217 qeth_l2_process_vlans(card); in __qeth_l2_set_online()
1219 netif_tx_disable(card->dev); in __qeth_l2_set_online()
1221 rc = qeth_init_qdio_queues(card); in __qeth_l2_set_online()
1227 card->state = CARD_STATE_SOFTSETUP; in __qeth_l2_set_online()
1228 if (card->lan_online) in __qeth_l2_set_online()
1229 netif_carrier_on(card->dev); in __qeth_l2_set_online()
1231 netif_carrier_off(card->dev); in __qeth_l2_set_online()
1233 qeth_set_allowed_threads(card, 0xffffffff, 0); in __qeth_l2_set_online()
1236 card->info.type != QETH_CARD_TYPE_OSN) { in __qeth_l2_set_online()
1237 __qeth_l2_open(card->dev); in __qeth_l2_set_online()
1240 dev_open(card->dev); in __qeth_l2_set_online()
1244 qeth_l2_set_rx_mode(card->dev); in __qeth_l2_set_online()
1246 qeth_recover_features(card->dev); in __qeth_l2_set_online()
1251 mutex_unlock(&card->conf_mutex); in __qeth_l2_set_online()
1252 mutex_unlock(&card->discipline_mutex); in __qeth_l2_set_online()
1256 qeth_l2_stop_card(card, 0); in __qeth_l2_set_online()
1257 ccw_device_set_offline(CARD_DDEV(card)); in __qeth_l2_set_online()
1258 ccw_device_set_offline(CARD_WDEV(card)); in __qeth_l2_set_online()
1259 ccw_device_set_offline(CARD_RDEV(card)); in __qeth_l2_set_online()
1260 qdio_free(CARD_DDEV(card)); in __qeth_l2_set_online()
1262 card->state = CARD_STATE_RECOVER; in __qeth_l2_set_online()
1264 card->state = CARD_STATE_DOWN; in __qeth_l2_set_online()
1265 mutex_unlock(&card->conf_mutex); in __qeth_l2_set_online()
1266 mutex_unlock(&card->discipline_mutex); in __qeth_l2_set_online()
1278 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); in __qeth_l2_set_offline() local
1282 mutex_lock(&card->discipline_mutex); in __qeth_l2_set_offline()
1283 mutex_lock(&card->conf_mutex); in __qeth_l2_set_offline()
1285 QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *)); in __qeth_l2_set_offline()
1287 if (card->dev && netif_carrier_ok(card->dev)) in __qeth_l2_set_offline()
1288 netif_carrier_off(card->dev); in __qeth_l2_set_offline()
1289 recover_flag = card->state; in __qeth_l2_set_offline()
1290 if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) { in __qeth_l2_set_offline()
1291 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in __qeth_l2_set_offline()
1292 card->info.hwtrap = 1; in __qeth_l2_set_offline()
1294 qeth_l2_stop_card(card, recovery_mode); in __qeth_l2_set_offline()
1295 rc = ccw_device_set_offline(CARD_DDEV(card)); in __qeth_l2_set_offline()
1296 rc2 = ccw_device_set_offline(CARD_WDEV(card)); in __qeth_l2_set_offline()
1297 rc3 = ccw_device_set_offline(CARD_RDEV(card)); in __qeth_l2_set_offline()
1302 qdio_free(CARD_DDEV(card)); in __qeth_l2_set_offline()
1304 card->state = CARD_STATE_RECOVER; in __qeth_l2_set_offline()
1307 mutex_unlock(&card->conf_mutex); in __qeth_l2_set_offline()
1308 mutex_unlock(&card->discipline_mutex); in __qeth_l2_set_offline()
1319 struct qeth_card *card; in qeth_l2_recover() local
1322 card = (struct qeth_card *) ptr; in qeth_l2_recover()
1323 QETH_CARD_TEXT(card, 2, "recover1"); in qeth_l2_recover()
1324 if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) in qeth_l2_recover()
1326 QETH_CARD_TEXT(card, 2, "recover2"); in qeth_l2_recover()
1327 dev_warn(&card->gdev->dev, in qeth_l2_recover()
1329 qeth_set_recovery_task(card); in qeth_l2_recover()
1330 __qeth_l2_set_offline(card->gdev, 1); in qeth_l2_recover()
1331 rc = __qeth_l2_set_online(card->gdev, 1); in qeth_l2_recover()
1333 dev_info(&card->gdev->dev, in qeth_l2_recover()
1336 qeth_close_dev(card); in qeth_l2_recover()
1337 dev_warn(&card->gdev->dev, "The qeth device driver " in qeth_l2_recover()
1340 qeth_clear_recovery_task(card); in qeth_l2_recover()
1341 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); in qeth_l2_recover()
1342 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); in qeth_l2_recover()
1359 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_shutdown() local
1360 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_shutdown()
1361 if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap) in qeth_l2_shutdown()
1362 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_l2_shutdown()
1363 qeth_qdio_clear_card(card, 0); in qeth_l2_shutdown()
1364 qeth_clear_qdio_buffers(card); in qeth_l2_shutdown()
1365 qdio_free(CARD_DDEV(card)); in qeth_l2_shutdown()
1370 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_pm_suspend() local
1372 if (card->dev) in qeth_l2_pm_suspend()
1373 netif_device_detach(card->dev); in qeth_l2_pm_suspend()
1374 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_pm_suspend()
1375 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l2_pm_suspend()
1378 if (card->state == CARD_STATE_UP) { in qeth_l2_pm_suspend()
1379 if (card->info.hwtrap) in qeth_l2_pm_suspend()
1380 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_l2_pm_suspend()
1381 __qeth_l2_set_offline(card->gdev, 1); in qeth_l2_pm_suspend()
1383 __qeth_l2_set_offline(card->gdev, 0); in qeth_l2_pm_suspend()
1389 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_pm_resume() local
1395 if (card->state == CARD_STATE_RECOVER) { in qeth_l2_pm_resume()
1396 rc = __qeth_l2_set_online(card->gdev, 1); in qeth_l2_pm_resume()
1399 dev_close(card->dev); in qeth_l2_pm_resume()
1403 rc = __qeth_l2_set_online(card->gdev, 0); in qeth_l2_pm_resume()
1405 qeth_set_allowed_threads(card, 0xffffffff, 0); in qeth_l2_pm_resume()
1406 if (card->dev) in qeth_l2_pm_resume()
1407 netif_device_attach(card->dev); in qeth_l2_pm_resume()
1409 dev_warn(&card->gdev->dev, "The qeth device driver " in qeth_l2_pm_resume()
1415 static int qeth_l2_control_event(struct qeth_card *card, in qeth_l2_control_event() argument
1423 qeth_bridge_state_change(card, cmd); in qeth_l2_control_event()
1428 qeth_bridge_host_event(card, cmd); in qeth_l2_control_event()
1453 static int qeth_osn_send_control_data(struct qeth_card *card, int len, in qeth_osn_send_control_data() argument
1459 QETH_CARD_TEXT(card, 5, "osndctrd"); in qeth_osn_send_control_data()
1461 wait_event(card->wait_q, in qeth_osn_send_control_data()
1462 atomic_cmpxchg(&card->write.irq_pending, 0, 1) == 0); in qeth_osn_send_control_data()
1463 qeth_prepare_control_data(card, len, iob); in qeth_osn_send_control_data()
1464 QETH_CARD_TEXT(card, 6, "osnoirqp"); in qeth_osn_send_control_data()
1465 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags); in qeth_osn_send_control_data()
1466 rc = ccw_device_start(card->write.ccwdev, &card->write.ccw, in qeth_osn_send_control_data()
1468 spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags); in qeth_osn_send_control_data()
1472 QETH_CARD_TEXT_(card, 2, " err%d", rc); in qeth_osn_send_control_data()
1474 atomic_set(&card->write.irq_pending, 0); in qeth_osn_send_control_data()
1475 wake_up(&card->wait_q); in qeth_osn_send_control_data()
1480 static int qeth_osn_send_ipa_cmd(struct qeth_card *card, in qeth_osn_send_ipa_cmd() argument
1485 QETH_CARD_TEXT(card, 4, "osndipa"); in qeth_osn_send_ipa_cmd()
1487 qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); in qeth_osn_send_ipa_cmd()
1494 return qeth_osn_send_control_data(card, s1, iob); in qeth_osn_send_ipa_cmd()
1500 struct qeth_card *card; in qeth_osn_assist() local
1505 card = dev->ml_priv; in qeth_osn_assist()
1506 if (!card) in qeth_osn_assist()
1508 QETH_CARD_TEXT(card, 2, "osnsdmc"); in qeth_osn_assist()
1509 if (!qeth_card_hw_is_reachable(card)) in qeth_osn_assist()
1511 iob = qeth_wait_for_buffer(&card->write); in qeth_osn_assist()
1513 rc = qeth_osn_send_ipa_cmd(card, iob, data_len); in qeth_osn_assist()
1522 struct qeth_card *card; in qeth_osn_register() local
1527 card = (*dev)->ml_priv; in qeth_osn_register()
1528 if (!card) in qeth_osn_register()
1530 QETH_CARD_TEXT(card, 2, "osnreg"); in qeth_osn_register()
1533 card->osn_info.assist_cb = assist_cb; in qeth_osn_register()
1534 card->osn_info.data_cb = data_cb; in qeth_osn_register()
1541 struct qeth_card *card; in qeth_osn_deregister() local
1545 card = dev->ml_priv; in qeth_osn_deregister()
1546 if (!card) in qeth_osn_deregister()
1548 QETH_CARD_TEXT(card, 2, "osndereg"); in qeth_osn_deregister()
1549 card->osn_info.assist_cb = NULL; in qeth_osn_deregister()
1550 card->osn_info.data_cb = NULL; in qeth_osn_deregister()
1574 static void qeth_bridge_emit_host_event(struct qeth_card *card, in qeth_bridge_emit_host_event() argument
1619 kobject_uevent_env(&card->gdev->dev.kobj, KOBJ_CHANGE, env); in qeth_bridge_emit_host_event()
1624 struct qeth_card *card; member
1646 mutex_lock(&data->card->conf_mutex); in qeth_bridge_state_change_worker()
1647 data->card->options.sbp.role = entry->role; in qeth_bridge_state_change_worker()
1648 mutex_unlock(&data->card->conf_mutex); in qeth_bridge_state_change_worker()
1661 kobject_uevent_env(&data->card->gdev->dev.kobj, in qeth_bridge_state_change_worker()
1666 static void qeth_bridge_state_change(struct qeth_card *card, in qeth_bridge_state_change() argument
1674 QETH_CARD_TEXT(card, 2, "brstchng"); in qeth_bridge_state_change()
1676 QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length); in qeth_bridge_state_change()
1683 QETH_CARD_TEXT(card, 2, "BPSalloc"); in qeth_bridge_state_change()
1687 data->card = card; in qeth_bridge_state_change()
1695 struct qeth_card *card; member
1706 dev_info(&data->card->gdev->dev, in qeth_bridge_host_event_worker()
1708 data->card->dev->name, in qeth_bridge_host_event_worker()
1714 mutex_lock(&data->card->conf_mutex); in qeth_bridge_host_event_worker()
1715 data->card->options.sbp.hostnotification = 0; in qeth_bridge_host_event_worker()
1716 mutex_unlock(&data->card->conf_mutex); in qeth_bridge_host_event_worker()
1717 qeth_bridge_emit_host_event(data->card, anev_abort, in qeth_bridge_host_event_worker()
1723 qeth_bridge_emit_host_event(data->card, in qeth_bridge_host_event_worker()
1731 static void qeth_bridge_host_event(struct qeth_card *card, in qeth_bridge_host_event() argument
1739 QETH_CARD_TEXT(card, 2, "brhostev"); in qeth_bridge_host_event()
1745 QETH_CARD_TEXT_(card, 2, "BPHe%04x", in qeth_bridge_host_event()
1755 QETH_CARD_TEXT(card, 2, "BPHalloc"); in qeth_bridge_host_event()
1759 data->card = card; in qeth_bridge_host_event()
1787 static int qeth_bridgeport_makerc(struct qeth_card *card, in qeth_bridgeport_makerc() argument
1791 int is_iqd = (card->info.type == QETH_CARD_TYPE_IQD); in qeth_bridgeport_makerc()
1806 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1812 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1820 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1825 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1835 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1841 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1847 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1853 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1872 QETH_CARD_TEXT_(card, 2, "SBPi%04x", cbctl->ipa_rc); in qeth_bridgeport_makerc()
1873 QETH_CARD_TEXT_(card, 2, "SBPc%04x", cbctl->cmd_rc); in qeth_bridgeport_makerc()
1878 static inline int ipa_cmd_sbp(struct qeth_card *card) in ipa_cmd_sbp() argument
1880 return (card->info.type == QETH_CARD_TYPE_IQD) ? in ipa_cmd_sbp()
1885 static int qeth_bridgeport_query_support_cb(struct qeth_card *card, in qeth_bridgeport_query_support_cb() argument
1890 QETH_CARD_TEXT(card, 2, "brqsupcb"); in qeth_bridgeport_query_support_cb()
1909 static void qeth_bridgeport_query_support(struct qeth_card *card) in qeth_bridgeport_query_support() argument
1915 QETH_CARD_TEXT(card, 2, "brqsuppo"); in qeth_bridgeport_query_support()
1916 iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); in qeth_bridgeport_query_support()
1927 if (qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_support_cb, in qeth_bridgeport_query_support()
1929 qeth_bridgeport_makerc(card, &cbctl, in qeth_bridgeport_query_support()
1932 card->options.sbp.role = QETH_SBP_ROLE_NONE; in qeth_bridgeport_query_support()
1935 card->options.sbp.supported_funcs = cbctl.data.supported; in qeth_bridgeport_query_support()
1938 static int qeth_bridgeport_query_ports_cb(struct qeth_card *card, in qeth_bridgeport_query_ports_cb() argument
1945 QETH_CARD_TEXT(card, 2, "brqprtcb"); in qeth_bridgeport_query_ports_cb()
1952 QETH_CARD_TEXT_(card, 2, "SBPs%04x", qports->entry_length); in qeth_bridgeport_query_ports_cb()
1975 int qeth_bridgeport_query_ports(struct qeth_card *card, in qeth_bridgeport_query_ports() argument
1990 QETH_CARD_TEXT(card, 2, "brqports"); in qeth_bridgeport_query_ports()
1991 if (!(card->options.sbp.supported_funcs & IPA_SBP_QUERY_BRIDGE_PORTS)) in qeth_bridgeport_query_ports()
1993 iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); in qeth_bridgeport_query_ports()
2003 rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_ports_cb, in qeth_bridgeport_query_ports()
2007 return qeth_bridgeport_makerc(card, &cbctl, IPA_SBP_QUERY_BRIDGE_PORTS); in qeth_bridgeport_query_ports()
2011 static int qeth_bridgeport_set_cb(struct qeth_card *card, in qeth_bridgeport_set_cb() argument
2016 QETH_CARD_TEXT(card, 2, "brsetrcb"); in qeth_bridgeport_set_cb()
2029 int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role) in qeth_bridgeport_setrole() argument
2038 QETH_CARD_TEXT(card, 2, "brsetrol"); in qeth_bridgeport_setrole()
2058 if (!(card->options.sbp.supported_funcs & setcmd)) in qeth_bridgeport_setrole()
2060 iob = qeth_get_ipacmd_buffer(card, ipa_cmd_sbp(card), 0); in qeth_bridgeport_setrole()
2068 rc = qeth_send_ipa_cmd(card, iob, qeth_bridgeport_set_cb, in qeth_bridgeport_setrole()
2072 return qeth_bridgeport_makerc(card, &cbctl, setcmd); in qeth_bridgeport_setrole()
2081 static int qeth_anset_makerc(struct qeth_card *card, int pnso_rc, u16 response) in qeth_anset_makerc() argument
2094 dev_err(&card->gdev->dev, in qeth_anset_makerc()
2107 QETH_CARD_TEXT_(card, 2, "SBPp%04x", pnso_rc); in qeth_anset_makerc()
2108 QETH_CARD_TEXT_(card, 2, "SBPr%04x", response); in qeth_anset_makerc()
2116 struct qeth_card *card = (struct qeth_card *)priv; in qeth_bridgeport_an_set_cb() local
2129 qeth_bridge_emit_host_event(card, anev_reg_unreg, code, in qeth_bridgeport_an_set_cb()
2144 int qeth_bridgeport_an_set(struct qeth_card *card, int enable) in qeth_bridgeport_an_set() argument
2151 if (!card) in qeth_bridgeport_an_set()
2153 if (!card->options.sbp.supported_funcs) in qeth_bridgeport_an_set()
2155 ddev = CARD_DDEV(card); in qeth_bridgeport_an_set()
2159 qeth_bridge_emit_host_event(card, anev_reset, 0, NULL, NULL); in qeth_bridgeport_an_set()
2161 qeth_bridgeport_an_set_cb, card); in qeth_bridgeport_an_set()
2164 return qeth_anset_makerc(card, rc, response); in qeth_bridgeport_an_set()