diff --git a/sys/dev/liquidio/lio_core.c b/sys/dev/liquidio/lio_core.c index dcbe4e44988d..ea6949f0354d 100644 --- a/sys/dev/liquidio/lio_core.c +++ b/sys/dev/liquidio/lio_core.c @@ -44,7 +44,7 @@ #include "lio_network.h" int -lio_set_feature(struct ifnet *ifp, int cmd, uint16_t param1) +lio_set_feature(if_t ifp, int cmd, uint16_t param1) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -263,7 +263,7 @@ lio_push_packet(void *m_buff, uint32_t len, union octeon_rh *rh, void *rxq, void *arg) { struct mbuf *mbuf = m_buff; - struct ifnet *ifp = arg; + if_t ifp = arg; struct lio_droq *droq = rxq; if (ifp != NULL) { @@ -407,7 +407,7 @@ lio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx, uint32_t num_iqs, uint32_t num_oqs) { struct lio_droq_ops droq_ops; - struct ifnet *ifp; + if_t ifp; struct lio_droq *droq; struct lio *lio; static int cpu_id, cpu_id_modulus; diff --git a/sys/dev/liquidio/lio_ioctl.c b/sys/dev/liquidio/lio_ioctl.c index f2cf0eae6f81..614c3cd1f868 100644 --- a/sys/dev/liquidio/lio_ioctl.c +++ b/sys/dev/liquidio/lio_ioctl.c @@ -46,13 +46,13 @@ #include "lio_main.h" #include "lio_rxtx.h" -static int lio_set_rx_csum(struct ifnet *ifp, uint32_t data); -static int lio_set_tso4(struct ifnet *ifp); -static int lio_set_tso6(struct ifnet *ifp); -static int lio_set_lro(struct ifnet *ifp); -static int lio_change_mtu(struct ifnet *ifp, int new_mtu); -static int lio_set_mcast_list(struct ifnet *ifp); -static inline enum lio_ifflags lio_get_new_flags(struct ifnet *ifp); +static int lio_set_rx_csum(if_t ifp, uint32_t data); +static int lio_set_tso4(if_t ifp); +static int lio_set_tso6(if_t ifp); +static int lio_set_lro(if_t ifp); +static int lio_change_mtu(if_t ifp, int new_mtu); +static int lio_set_mcast_list(if_t ifp); +static inline enum lio_ifflags lio_get_new_flags(if_t ifp); static inline bool lio_is_valid_ether_addr(const uint8_t *addr) @@ -63,7 +63,7 @@ lio_is_valid_ether_addr(const uint8_t *addr) } static int -lio_change_dev_flags(struct ifnet *ifp) +lio_change_dev_flags(if_t ifp) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -94,7 +94,7 @@ lio_change_dev_flags(struct ifnet *ifp) * return 0 on success, positive on failure */ int -lio_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +lio_ioctl(if_t ifp, u_long cmd, caddr_t data) { struct lio *lio = if_getsoftc(ifp); struct ifreq *ifrequest = (struct ifreq *)data; @@ -211,7 +211,7 @@ lio_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } static int -lio_set_tso4(struct ifnet *ifp) +lio_set_tso4(if_t ifp) { struct lio *lio = if_getsoftc(ifp); @@ -230,7 +230,7 @@ lio_set_tso4(struct ifnet *ifp) } static int -lio_set_tso6(struct ifnet *ifp) +lio_set_tso6(if_t ifp) { struct lio *lio = if_getsoftc(ifp); @@ -249,7 +249,7 @@ lio_set_tso6(struct ifnet *ifp) } static int -lio_set_rx_csum(struct ifnet *ifp, uint32_t data) +lio_set_rx_csum(if_t ifp, uint32_t data) { struct lio *lio = if_getsoftc(ifp); int ret = 0; @@ -276,7 +276,7 @@ lio_set_rx_csum(struct ifnet *ifp, uint32_t data) } static int -lio_set_lro(struct ifnet *ifp) +lio_set_lro(if_t ifp) { struct lio *lio = if_getsoftc(ifp); int ret = 0; @@ -338,7 +338,7 @@ lio_mtu_ctl_callback(struct octeon_device *oct, uint32_t status, void *buf) /* @param ifp is network device */ static int -lio_change_mtu(struct ifnet *ifp, int new_mtu) +lio_change_mtu(if_t ifp, int new_mtu) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; @@ -421,7 +421,7 @@ lio_change_mtu(struct ifnet *ifp, int new_mtu) /* @param ifp network device */ int -lio_set_mac(struct ifnet *ifp, uint8_t *p) +lio_set_mac(if_t ifp, uint8_t *p) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -465,7 +465,7 @@ lio_set_mac(struct ifnet *ifp, uint8_t *p) * received from the OS. */ static inline enum lio_ifflags -lio_get_new_flags(struct ifnet *ifp) +lio_get_new_flags(if_t ifp) { enum lio_ifflags f = LIO_IFFLAG_UNICAST; @@ -509,7 +509,7 @@ lio_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) /* @param ifp network device */ static int -lio_set_mcast_list(struct ifnet *ifp) +lio_set_mcast_list(if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; diff --git a/sys/dev/liquidio/lio_ioctl.h b/sys/dev/liquidio/lio_ioctl.h index d62948bafc7b..1c8db95e0c0b 100644 --- a/sys/dev/liquidio/lio_ioctl.h +++ b/sys/dev/liquidio/lio_ioctl.h @@ -35,10 +35,10 @@ #ifndef _LIO_IOCTL_H_ #define _LIO_IOCTL_H_ -int lio_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +int lio_ioctl(if_t ifp, u_long cmd, caddr_t data); void lio_add_hw_stats(struct lio *lio); -void lio_stop(struct ifnet *ifp); +void lio_stop(if_t ifp); void lio_open(void *arg); -int lio_set_mac(struct ifnet *ifp, uint8_t *p); +int lio_set_mac(if_t ifp, uint8_t *p); #endif /* _LIO_IOCTL_H_ */ diff --git a/sys/dev/liquidio/lio_main.c b/sys/dev/liquidio/lio_main.c index 4406b86f55d8..7f4fe01ffaca 100644 --- a/sys/dev/liquidio/lio_main.c +++ b/sys/dev/liquidio/lio_main.c @@ -105,20 +105,20 @@ static int lio_setup_nic_devices(struct octeon_device *octeon_dev); static int lio_link_info(struct lio_recv_info *recv_info, void *ptr); static void lio_if_cfg_callback(struct octeon_device *oct, uint32_t status, void *buf); -static int lio_set_rxcsum_command(struct ifnet *ifp, int command, +static int lio_set_rxcsum_command(if_t ifp, int command, uint8_t rx_cmd); static int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs); static void lio_destroy_nic_device(struct octeon_device *oct, int ifidx); -static inline void lio_update_link_status(struct ifnet *ifp, +static inline void lio_update_link_status(if_t ifp, union octeon_link_status *ls); static void lio_send_rx_ctrl_cmd(struct lio *lio, int start_stop); static int lio_stop_nic_module(struct octeon_device *oct); static void lio_destroy_resources(struct octeon_device *oct); -static int lio_setup_rx_oom_poll_fn(struct ifnet *ifp); +static int lio_setup_rx_oom_poll_fn(if_t ifp); -static void lio_vlan_rx_add_vid(void *arg, struct ifnet *ifp, uint16_t vid); -static void lio_vlan_rx_kill_vid(void *arg, struct ifnet *ifp, +static void lio_vlan_rx_add_vid(void *arg, if_t ifp, uint16_t vid); +static void lio_vlan_rx_kill_vid(void *arg, if_t ifp, uint16_t vid); static struct octeon_device * lio_get_other_octeon_device(struct octeon_device *oct); @@ -965,7 +965,7 @@ lio_init_nic_module(struct octeon_device *oct) } static int -lio_ifmedia_update(struct ifnet *ifp) +lio_ifmedia_update(if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct ifmedia *ifm; @@ -1030,7 +1030,7 @@ lio_get_baudrate(struct octeon_device *oct) } static void -lio_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr) +lio_ifmedia_status(if_t ifp, struct ifmediareq *ifmr) { struct lio *lio = if_getsoftc(ifp); @@ -1129,7 +1129,7 @@ static int lio_init_ifnet(struct lio *lio) { struct octeon_device *oct = lio->oct_dev; - if_t ifp = lio->ifp; + if_t ifp = lio->ifp; /* ifconfig entrypoint for media type/status reporting */ ifmedia_init(&lio->ifmedia, IFM_IMASK, lio_ifmedia_update, @@ -1172,7 +1172,7 @@ lio_init_ifnet(struct lio *lio) } static void -lio_tcp_lro_free(struct octeon_device *octeon_dev, struct ifnet *ifp) +lio_tcp_lro_free(struct octeon_device *octeon_dev, if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct lio_droq *droq; @@ -1190,7 +1190,7 @@ lio_tcp_lro_free(struct octeon_device *octeon_dev, struct ifnet *ifp) } static int -lio_tcp_lro_init(struct octeon_device *octeon_dev, struct ifnet *ifp) +lio_tcp_lro_init(struct octeon_device *octeon_dev, if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct lio_droq *droq; @@ -1224,7 +1224,7 @@ lio_setup_nic_devices(struct octeon_device *octeon_dev) { union octeon_if_cfg if_cfg; struct lio *lio = NULL; - struct ifnet *ifp = NULL; + if_t ifp = NULL; struct lio_version *vdata; struct lio_soft_command *sc; struct lio_if_cfg_context *ctx; @@ -1344,9 +1344,9 @@ lio_setup_nic_devices(struct octeon_device *octeon_dev) if_setsoftc(ifp, lio); - ifp->if_hw_tsomax = LIO_MAX_FRAME_SIZE; - ifp->if_hw_tsomaxsegcount = LIO_MAX_SG; - ifp->if_hw_tsomaxsegsize = PAGE_SIZE; + if_sethwtsomax(ifp, LIO_MAX_FRAME_SIZE); + if_sethwtsomaxsegcount(ifp, LIO_MAX_SG); + if_sethwtsomaxsegsize(ifp, PAGE_SIZE); lio->ifidx = ifidx_or_pfnum; @@ -1590,7 +1590,7 @@ void lio_open(void *arg) { struct lio *lio = arg; - struct ifnet *ifp = lio->ifp; + if_t ifp = lio->ifp; struct octeon_device *oct = lio->oct_dev; uint8_t *mac_new, mac_old[ETHER_HDR_LEN]; int ret = 0; @@ -1605,7 +1605,7 @@ lio_open(void *arg) /* tell Octeon to start forwarding packets to host */ lio_send_rx_ctrl_cmd(lio, 1); - mac_new = IF_LLADDR(ifp); + mac_new = if_getlladdr(ifp); memcpy(mac_old, ((uint8_t *)&lio->linfo.hw_addr) + 2, ETHER_HDR_LEN); if (lio_is_mac_changed(mac_new, mac_old)) { @@ -1621,7 +1621,7 @@ lio_open(void *arg) } static int -lio_set_rxcsum_command(struct ifnet *ifp, int command, uint8_t rx_cmd) +lio_set_rxcsum_command(if_t ifp, int command, uint8_t rx_cmd) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -1786,7 +1786,7 @@ lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) } void -lio_stop(struct ifnet *ifp) +lio_stop(if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; @@ -1851,7 +1851,7 @@ lio_poll_check_rx_oom_status(void *arg, int pending __unused) } static int -lio_setup_rx_oom_poll_fn(struct ifnet *ifp) +lio_setup_rx_oom_poll_fn(if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; @@ -1883,7 +1883,7 @@ lio_setup_rx_oom_poll_fn(struct ifnet *ifp) } static void -lio_cleanup_rx_oom_poll_fn(struct ifnet *ifp) +lio_cleanup_rx_oom_poll_fn(if_t ifp) { struct lio *lio = if_getsoftc(ifp); @@ -1902,7 +1902,7 @@ lio_cleanup_rx_oom_poll_fn(struct ifnet *ifp) static void lio_destroy_nic_device(struct octeon_device *oct, int ifidx) { - struct ifnet *ifp = oct->props.ifp; + if_t ifp = oct->props.ifp; struct lio *lio; if (ifp == NULL) { @@ -1951,7 +1951,7 @@ lio_destroy_nic_device(struct octeon_device *oct, int ifidx) } static void -print_link_info(struct ifnet *ifp) +print_link_info(if_t ifp) { struct lio *lio = if_getsoftc(ifp); @@ -1970,7 +1970,7 @@ print_link_info(struct ifnet *ifp) } static inline void -lio_update_link_status(struct ifnet *ifp, union octeon_link_status *ls) +lio_update_link_status(if_t ifp, union octeon_link_status *ls) { struct lio *lio = if_getsoftc(ifp); int changed = (lio->linfo.link.link_status64 != ls->link_status64); @@ -2066,7 +2066,7 @@ lio_send_rx_ctrl_cmd(struct lio *lio, int start_stop) } static void -lio_vlan_rx_add_vid(void *arg, struct ifnet *ifp, uint16_t vid) +lio_vlan_rx_add_vid(void *arg, if_t ifp, uint16_t vid) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -2097,7 +2097,7 @@ lio_vlan_rx_add_vid(void *arg, struct ifnet *ifp, uint16_t vid) } static void -lio_vlan_rx_kill_vid(void *arg, struct ifnet *ifp, uint16_t vid) +lio_vlan_rx_kill_vid(void *arg, if_t ifp, uint16_t vid) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); diff --git a/sys/dev/liquidio/lio_network.h b/sys/dev/liquidio/lio_network.h index 5a843e4cf8ae..b29fc200a510 100644 --- a/sys/dev/liquidio/lio_network.h +++ b/sys/dev/liquidio/lio_network.h @@ -95,7 +95,7 @@ struct lio { /* Pointer to the octeon device structure. */ struct octeon_device *oct_dev; - struct ifnet *ifp; + if_t ifp; struct ifmedia ifmedia; int if_flags; @@ -139,7 +139,7 @@ struct lio { * @param cmd Command that just requires acknowledgment * @param param1 Parameter to command */ -int lio_set_feature(struct ifnet *ifp, int cmd, uint16_t param1); +int lio_set_feature(if_t ifp, int cmd, uint16_t param1); /* * \brief Link control command completion callback diff --git a/sys/dev/liquidio/lio_rxtx.c b/sys/dev/liquidio/lio_rxtx.c index c966797c5e3c..456fcc3449d6 100644 --- a/sys/dev/liquidio/lio_rxtx.c +++ b/sys/dev/liquidio/lio_rxtx.c @@ -228,7 +228,7 @@ lio_xmit(struct lio *lio, struct lio_instr_queue *iq, } int -lio_mq_start_locked(struct ifnet *ifp, struct lio_instr_queue *iq) +lio_mq_start_locked(if_t ifp, struct lio_instr_queue *iq) { struct lio *lio = if_getsoftc(ifp); struct mbuf *next; @@ -260,7 +260,7 @@ lio_mq_start_locked(struct ifnet *ifp, struct lio_instr_queue *iq) } int -lio_mq_start(struct ifnet *ifp, struct mbuf *m) +lio_mq_start(if_t ifp, struct mbuf *m) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; @@ -300,7 +300,7 @@ lio_mq_start(struct ifnet *ifp, struct mbuf *m) } void -lio_qflush(struct ifnet *ifp) +lio_qflush(if_t ifp) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; diff --git a/sys/dev/liquidio/lio_rxtx.h b/sys/dev/liquidio/lio_rxtx.h index cff25af147fb..b4059b35b1ea 100644 --- a/sys/dev/liquidio/lio_rxtx.h +++ b/sys/dev/liquidio/lio_rxtx.h @@ -80,7 +80,7 @@ union lio_tx_info { int lio_xmit(struct lio *lio, struct lio_instr_queue *iq, struct mbuf **m_headp); -int lio_mq_start_locked(struct ifnet *ifp, struct lio_instr_queue *iq); -int lio_mq_start(struct ifnet *ifp, struct mbuf *m); -void lio_qflush(struct ifnet *ifp); +int lio_mq_start_locked(if_t ifp, struct lio_instr_queue *iq); +int lio_mq_start(if_t ifp, struct mbuf *m); +void lio_qflush(if_t ifp); #endif /* _LIO_RXTX_H_ */ diff --git a/sys/dev/liquidio/lio_sysctl.c b/sys/dev/liquidio/lio_sysctl.c index cee520e63b60..c7a9bc5cda0e 100644 --- a/sys/dev/liquidio/lio_sysctl.c +++ b/sys/dev/liquidio/lio_sysctl.c @@ -105,7 +105,7 @@ struct lio_intrmod_resp { }; static int -lio_send_queue_count_update(struct ifnet *ifp, uint32_t num_queues) +lio_send_queue_count_update(if_t ifp, uint32_t num_queues) { struct lio_ctrl_pkt nctrl; struct lio *lio = if_getsoftc(ifp); @@ -732,7 +732,7 @@ lio_get_regs(SYSCTL_HANDLER_ARGS) { struct lio *lio = (struct lio *)arg1; struct octeon_device *oct = lio->oct_dev; - struct ifnet *ifp = lio->ifp; + if_t ifp = lio->ifp; char *regbuf; int error = EINVAL, len = 0; @@ -984,7 +984,7 @@ lio_get_ringparam(SYSCTL_HANDLER_ARGS) } static int -lio_reset_queues(struct ifnet *ifp, uint32_t num_qs) +lio_reset_queues(if_t ifp, uint32_t num_qs) { struct lio *lio = if_getsoftc(ifp); struct octeon_device *oct = lio->oct_dev; @@ -1254,7 +1254,7 @@ static int lio_get_set_fwmsglevel(SYSCTL_HANDLER_ARGS) { struct lio *lio = (struct lio *)arg1; - struct ifnet *ifp = lio->ifp; + if_t ifp = lio->ifp; int err, new_msglvl = 0, old_msglvl = 0; if (lio_ifstate_check(lio, LIO_IFSTATE_RESETTING)) @@ -1311,7 +1311,7 @@ lio_fw_stats_callback(struct octeon_device *oct_dev, uint32_t status, void *ptr) struct octeon_tx_stats *rsp_tstats = &resp->stats.fromhost; struct octeon_rx_stats *rstats = &oct_dev->link_stats.fromwire; struct octeon_tx_stats *tstats = &oct_dev->link_stats.fromhost; - struct ifnet *ifp = oct_dev->props.ifp; + if_t ifp = oct_dev->props.ifp; struct lio *lio = if_getsoftc(ifp); if ((status != LIO_REQUEST_TIMEOUT) && !resp->status) { @@ -1446,7 +1446,7 @@ lio_get_intrmod_callback(struct octeon_device *oct_dev, uint32_t status, void *ptr) { struct lio_soft_command *sc = (struct lio_soft_command *)ptr; - struct ifnet *ifp = oct_dev->props.ifp; + if_t ifp = oct_dev->props.ifp; struct lio *lio = if_getsoftc(ifp); struct lio_intrmod_resp *resp;