Author: jhb
Date: Tue Nov 24 16:57:35 2009
New Revision: 199757
URL: http://svn.freebsd.org/changeset/base/199757

Log:
  - For 350 chips, don't set various INTR bits in TX control word; turning INTR
    bits on seems to confuse hardware TX engine.
  - For 350 chips, set TX desc's buffer physical address before turning on the
    TX desc valid bit.
  
  Submitted by: Jeremy O'Brien  obrien654j | gmail, sephe
  Obtained from:        DragonFly BSD

Modified:
  head/sys/dev/an/if_an.c
  head/sys/dev/an/if_anreg.h

Modified: head/sys/dev/an/if_an.c
==============================================================================
--- head/sys/dev/an/if_an.c     Tue Nov 24 16:54:54 2009        (r199756)
+++ head/sys/dev/an/if_an.c     Tue Nov 24 16:57:35 2009        (r199757)
@@ -2800,7 +2800,7 @@ an_start_locked(struct ifnet *ifp)
                                   tx_frame_802_3.an_tx_802_3_payload_len,
                                   (caddr_t)&sc->an_txbuf);
 
-                       txcontrol = AN_TXCTL_8023;
+                       txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
                        /* write the txcontrol only */
                        an_write_data(sc, id, 0x08, (caddr_t)&txcontrol,
                                      sizeof(txcontrol));
@@ -2863,7 +2863,7 @@ an_start_locked(struct ifnet *ifp)
                                   tx_frame_802_3.an_tx_802_3_payload_len,
                                   (caddr_t)&sc->an_txbuf);
 
-                       txcontrol = AN_TXCTL_8023;
+                       txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
                        /* write the txcontrol only */
                        bcopy((caddr_t)&txcontrol, &buf[0x08],
                              sizeof(txcontrol));
@@ -2885,7 +2885,7 @@ an_start_locked(struct ifnet *ifp)
                            tx_frame_802_3.an_tx_802_3_payload_len;
                        an_tx_desc.an_phys
                            = sc->an_tx_buffer[idx].an_dma_paddr;
-                       for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) {
+                       for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) {
                                CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET
                                    /* zero for now */
                                    + (0 * sizeof(an_tx_desc))

Modified: head/sys/dev/an/if_anreg.h
==============================================================================
--- head/sys/dev/an/if_anreg.h  Tue Nov 24 16:54:54 2009        (r199756)
+++ head/sys/dev/an/if_anreg.h  Tue Nov 24 16:57:35 2009        (r199757)
@@ -386,13 +386,18 @@ struct an_txframe_802_3 {
 #define AN_PAYLOADTYPE_ETHER   0x0000
 #define AN_PAYLOADTYPE_LLC     0x0010
 
-#define AN_TXCTL_80211 \
-       (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|    \
-       AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
-
-#define AN_TXCTL_8023  \
-       (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|     \
-       AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
+#define AN_TXCTL_80211         (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC)
+
+#define AN_TXCTL_8023          (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER)
+
+/*
+ * Additions to transmit control bits for MPI350
+ */
+#define        AN_TXCTL_HW(x)  \
+       ( x ? (AN_TXCTL_NORELEASE) \
+         : \
+             (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \
+             )
 
 #define AN_TXGAP_80211         0
 #define AN_TXGAP_8023          0
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to