Index: if_em.c =================================================================== RCS file: /usr/cvs/src/sys/dev/em/if_em.c,v retrieving revision 1.144 diff -u -r1.144 if_em.c --- if_em.c 11 Sep 2006 20:59:01 -0000 1.144 +++ if_em.c 15 Sep 2006 16:14:53 -0000 @@ -241,7 +241,6 @@ static void em_update_link_status(struct adapter *); static int em_get_buf(struct adapter *, int); static void em_enable_vlans(struct adapter *); -static void em_disable_vlans(struct adapter *); static int em_encap(struct adapter *, struct mbuf **); static void em_smartspeed(struct adapter *); static int em_82547_fifo_workaround(struct adapter *, int); @@ -1474,42 +1469,6 @@ mtag = VLAN_OUTPUT_TAG(ifp, m_head); /* - * When operating in promiscuous mode, hardware encapsulation for - * packets is disabled. This means we have to add the vlan - * encapsulation in the driver, since it will have come down from the - * VLAN layer with a tag instead of a VLAN header. - */ - if (mtag != NULL && adapter->em_insert_vlan_header) { - struct ether_vlan_header *evl; - struct ether_header eh; - - m_head = m_pullup(m_head, sizeof(eh)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } - eh = *mtod(m_head, struct ether_header *); - M_PREPEND(m_head, sizeof(*evl), M_DONTWAIT); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } - m_head = m_pullup(m_head, sizeof(*evl)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } - evl = mtod(m_head, struct ether_vlan_header *); - bcopy(&eh, evl, sizeof(*evl)); - evl->evl_proto = evl->evl_encap_proto; - evl->evl_encap_proto = htons(ETHERTYPE_VLAN); - evl->evl_tag = htons(VLAN_TAG_VALUE(mtag)); - m_tag_delete(m_head, mtag); - mtag = NULL; - *m_headp = m_head; - } - - /* * TSO workaround: * If an mbuf is only header we need * to pull 4 bytes of data into it. @@ -1849,20 +1803,11 @@ if (ifp->if_flags & IFF_PROMISC) { reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); E1000_WRITE_REG(&adapter->hw, RCTL, reg_rctl); - /* Disable VLAN stripping in promiscous mode - * This enables bridging of vlan tagged frames to occur - * and also allows vlan tags to be seen in tcpdump - */ - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) - em_disable_vlans(adapter); - adapter->em_insert_vlan_header = 1; } else if (ifp->if_flags & IFF_ALLMULTI) { reg_rctl |= E1000_RCTL_MPE; reg_rctl &= ~E1000_RCTL_UPE; E1000_WRITE_REG(&adapter->hw, RCTL, reg_rctl); - adapter->em_insert_vlan_header = 0; - } else - adapter->em_insert_vlan_header = 0; + } } static void @@ -1876,10 +1821,6 @@ reg_rctl &= (~E1000_RCTL_UPE); reg_rctl &= (~E1000_RCTL_MPE); E1000_WRITE_REG(&adapter->hw, RCTL, reg_rctl); - - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) - em_enable_vlans(adapter); - adapter->em_insert_vlan_header = 0; } @@ -3566,16 +3507,6 @@ } static void -em_disable_vlans(struct adapter *adapter) -{ - uint32_t ctrl; - - ctrl = E1000_READ_REG(&adapter->hw, CTRL); - ctrl &= ~E1000_CTRL_VME; - E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); -} - -static void em_enable_intr(struct adapter *adapter) { E1000_WRITE_REG(&adapter->hw, IMS, (IMS_ENABLE_MASK)); Index: if_em.h =================================================================== RCS file: /usr/cvs/src/sys/dev/em/if_em.h,v retrieving revision 1.50 diff -u -r1.50 if_em.h --- if_em.h 9 Sep 2006 06:19:20 -0000 1.50 +++ if_em.h 15 Sep 2006 16:12:04 -0000 @@ -278,7 +278,6 @@ int io_rid; int if_flags; struct mtx mtx; - int em_insert_vlan_header; struct task link_task; struct task rxtx_task; struct taskqueue *tq; /* private task queue */