diff options
Diffstat (limited to 'sys/dev/oce/oce_if.c')
-rw-r--r-- | sys/dev/oce/oce_if.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index d7ec58ec1f5e..1906933fa75a 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -170,7 +170,7 @@ static void oce_rx_lro(struct oce_rq *rq, struct nic_hwlro_singleton_cqe *cqe, s static void oce_rx_mbuf_chain(struct oce_rq *rq, struct oce_common_cqe_info *cqe_info, struct mbuf **m); /* Helper function prototypes in this file */ -static int oce_attach_ifp(POCE_SOFTC sc); +static void oce_attach_ifp(POCE_SOFTC sc); static void oce_add_vlan(void *arg, if_t ifp, uint16_t vtag); static void oce_del_vlan(void *arg, if_t ifp, uint16_t vtag); static int oce_vid_config(POCE_SOFTC sc); @@ -252,7 +252,6 @@ oce_probe(device_t dev) uint16_t vendor = 0; uint16_t device = 0; int i = 0; - char str[256] = {0}; POCE_SOFTC sc; sc = device_get_softc(dev); @@ -265,9 +264,9 @@ oce_probe(device_t dev) for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint32_t)); i++) { if (vendor == ((supportedDevices[i] >> 16) & 0xffff)) { if (device == (supportedDevices[i] & 0xffff)) { - sprintf(str, "%s:%s", "Emulex CNA NIC function", - component_revision); - device_set_desc_copy(dev, str); + device_set_descf(dev, + "%s:%s", "Emulex CNA NIC function", + component_revision); switch (device) { case PCI_PRODUCT_BE2: @@ -335,9 +334,7 @@ oce_attach(device_t dev) if (rc) goto intr_free; - rc = oce_attach_ifp(sc); - if (rc) - goto queues_free; + oce_attach_ifp(sc); #if defined(INET6) || defined(INET) rc = oce_init_lro(sc); @@ -373,8 +370,6 @@ oce_attach(device_t dev) } softc_tail = sc; - gone_in_dev(dev, 15, "relatively uncommon 10GbE NIC"); - return 0; stats_free: @@ -393,7 +388,6 @@ ifp_free: #endif ether_ifdetach(sc->ifp); if_free(sc->ifp); -queues_free: oce_queue_release_all(sc); intr_free: oce_intr_free(sc); @@ -1498,7 +1492,7 @@ oce_correct_header(struct mbuf *m, struct nic_hwlro_cqe_part1 *cqe1, struct nic_ /* correct tcp header */ tcp_hdr->th_ack = htonl(cqe2->tcp_ack_num); if(cqe2->push) { - tcp_hdr->th_flags |= TH_PUSH; + tcp_set_flags(tcp_hdr, tcp_get_flags(tcp_hdr) | TH_PUSH); } tcp_hdr->th_win = htons(cqe2->tcp_window); tcp_hdr->th_sum = 0xffff; @@ -2100,13 +2094,11 @@ oce_rq_handler(void *arg) * Helper function prototypes in this file * *****************************************************************************/ -static int +static void oce_attach_ifp(POCE_SOFTC sc) { sc->ifp = if_alloc(IFT_ETHER); - if (!sc->ifp) - return ENOMEM; ifmedia_init(&sc->media, IFM_IMASK, oce_media_change, oce_media_status); ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2149,8 +2141,6 @@ oce_attach_ifp(POCE_SOFTC sc) if_sethwtsomaxsegsize(sc->ifp, 4096); ether_ifattach(sc->ifp, sc->macaddr.mac_addr); - - return 0; } static void |