Lines 85-92
static void qlnx_init_ifnet(device_t dev, qlnx_host_t *ha);
Link Here
|
85 |
static void qlnx_init(void *arg); |
85 |
static void qlnx_init(void *arg); |
86 |
static void qlnx_init_locked(qlnx_host_t *ha); |
86 |
static void qlnx_init_locked(qlnx_host_t *ha); |
87 |
static int qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi); |
87 |
static int qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi); |
88 |
static int qlnx_set_promisc(qlnx_host_t *ha); |
88 |
static int qlnx_set_promisc(qlnx_host_t *ha, int enabled); |
89 |
static int qlnx_set_allmulti(qlnx_host_t *ha); |
89 |
static int qlnx_set_allmulti(qlnx_host_t *ha, int enabled); |
90 |
static int qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); |
90 |
static int qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); |
91 |
static int qlnx_media_change(struct ifnet *ifp); |
91 |
static int qlnx_media_change(struct ifnet *ifp); |
92 |
static void qlnx_media_status(struct ifnet *ifp, struct ifmediareq *ifmr); |
92 |
static void qlnx_media_status(struct ifnet *ifp, struct ifmediareq *ifmr); |
Lines 2630-2636
qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi)
Link Here
|
2630 |
} |
2630 |
} |
2631 |
|
2631 |
|
2632 |
static int |
2632 |
static int |
2633 |
qlnx_set_promisc(qlnx_host_t *ha) |
2633 |
qlnx_set_promisc(qlnx_host_t *ha, int enabled) |
2634 |
{ |
2634 |
{ |
2635 |
int rc = 0; |
2635 |
int rc = 0; |
2636 |
uint8_t filter; |
2636 |
uint8_t filter; |
Lines 2639-2653
qlnx_set_promisc(qlnx_host_t *ha)
Link Here
|
2639 |
return (0); |
2639 |
return (0); |
2640 |
|
2640 |
|
2641 |
filter = ha->filter; |
2641 |
filter = ha->filter; |
2642 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
2642 |
if (enabled) { |
2643 |
filter |= ECORE_ACCEPT_UCAST_UNMATCHED; |
2643 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
|
|
2644 |
filter |= ECORE_ACCEPT_UCAST_UNMATCHED; |
2645 |
} else { |
2646 |
filter &= ~ECORE_ACCEPT_MCAST_UNMATCHED; |
2647 |
filter &= ~ECORE_ACCEPT_UCAST_UNMATCHED; |
2648 |
} |
2644 |
|
2649 |
|
2645 |
rc = qlnx_set_rx_accept_filter(ha, filter); |
2650 |
rc = qlnx_set_rx_accept_filter(ha, filter); |
2646 |
return (rc); |
2651 |
return (rc); |
2647 |
} |
2652 |
} |
2648 |
|
2653 |
|
2649 |
static int |
2654 |
static int |
2650 |
qlnx_set_allmulti(qlnx_host_t *ha) |
2655 |
qlnx_set_allmulti(qlnx_host_t *ha, int enabled) |
2651 |
{ |
2656 |
{ |
2652 |
int rc = 0; |
2657 |
int rc = 0; |
2653 |
uint8_t filter; |
2658 |
uint8_t filter; |
Lines 2656-2662
qlnx_set_allmulti(qlnx_host_t *ha)
Link Here
|
2656 |
return (0); |
2661 |
return (0); |
2657 |
|
2662 |
|
2658 |
filter = ha->filter; |
2663 |
filter = ha->filter; |
2659 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
2664 |
if (enabled) { |
|
|
2665 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
2666 |
} else { |
2667 |
filter &= ~ECORE_ACCEPT_MCAST_UNMATCHED; |
2668 |
} |
2660 |
rc = qlnx_set_rx_accept_filter(ha, filter); |
2669 |
rc = qlnx_set_rx_accept_filter(ha, filter); |
2661 |
|
2670 |
|
2662 |
return (rc); |
2671 |
return (rc); |
Lines 2720-2729
qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
Link Here
|
2720 |
if (ifp->if_drv_flags & IFF_DRV_RUNNING) { |
2729 |
if (ifp->if_drv_flags & IFF_DRV_RUNNING) { |
2721 |
if ((ifp->if_flags ^ ha->if_flags) & |
2730 |
if ((ifp->if_flags ^ ha->if_flags) & |
2722 |
IFF_PROMISC) { |
2731 |
IFF_PROMISC) { |
2723 |
ret = qlnx_set_promisc(ha); |
2732 |
ret = qlnx_set_promisc(ha, ifp->if_flags & IFF_PROMISC); |
2724 |
} else if ((ifp->if_flags ^ ha->if_flags) & |
2733 |
} else if ((ifp->if_flags ^ ha->if_flags) & |
2725 |
IFF_ALLMULTI) { |
2734 |
IFF_ALLMULTI) { |
2726 |
ret = qlnx_set_allmulti(ha); |
2735 |
ret = qlnx_set_allmulti(ha, ifp->if_flags & IFF_ALLMULTI); |
2727 |
} |
2736 |
} |
2728 |
} else { |
2737 |
} else { |
2729 |
ha->max_frame_size = ifp->if_mtu + |
2738 |
ha->max_frame_size = ifp->if_mtu + |
Lines 2733-2741
qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
Link Here
|
2733 |
} else { |
2742 |
} else { |
2734 |
if (ifp->if_drv_flags & IFF_DRV_RUNNING) |
2743 |
if (ifp->if_drv_flags & IFF_DRV_RUNNING) |
2735 |
qlnx_stop(ha); |
2744 |
qlnx_stop(ha); |
2736 |
ha->if_flags = ifp->if_flags; |
|
|
2737 |
} |
2745 |
} |
2738 |
|
2746 |
|
|
|
2747 |
ha->if_flags = ifp->if_flags; |
2739 |
QLNX_UNLOCK(ha); |
2748 |
QLNX_UNLOCK(ha); |
2740 |
break; |
2749 |
break; |
2741 |
|
2750 |
|
Lines 7191-7199
qlnx_set_rx_mode(qlnx_host_t *ha)
Link Here
|
7191 |
ECORE_ACCEPT_MCAST_MATCHED | |
7200 |
ECORE_ACCEPT_MCAST_MATCHED | |
7192 |
ECORE_ACCEPT_BCAST; |
7201 |
ECORE_ACCEPT_BCAST; |
7193 |
|
7202 |
|
7194 |
if (qlnx_vf_device(ha) == 0) { |
7203 |
if (qlnx_vf_device(ha) == 0 || (ha->ifp->if_flags & IFF_PROMISC)) { |
7195 |
filter |= ECORE_ACCEPT_UCAST_UNMATCHED; |
7204 |
filter |= ECORE_ACCEPT_UCAST_UNMATCHED; |
7196 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
7205 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
|
|
7206 |
} else if (ha->ifp->if_flags & IFF_ALLMULTI) { |
7207 |
filter |= ECORE_ACCEPT_MCAST_UNMATCHED; |
7197 |
} |
7208 |
} |
7198 |
ha->filter = filter; |
7209 |
ha->filter = filter; |
7199 |
|
7210 |
|