Author: arybchik
Date: Sun Feb 22 07:08:57 2015
New Revision: 279141
URL: https://svnweb.freebsd.org/changeset/base/279141

Log:
  sfxge: style fixes and cleanup
  
  Sync endif comment with conditional.
  BOOTROM and SIENA_BOOTROM are the same, but highlight that it is Siena.
  Restore commented out assertion.
  Sync comments with out-of-tree driver.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:    gnn (mentor)

Modified:
  head/sys/dev/sfxge/common/efx_ev.c
  head/sys/dev/sfxge/common/efx_filter.c
  head/sys/dev/sfxge/common/efx_mcdi.c
  head/sys/dev/sfxge/common/efx_nic.c
  head/sys/dev/sfxge/common/efx_tx.c
  head/sys/dev/sfxge/common/siena_mac.c
  head/sys/dev/sfxge/common/siena_nic.c
  head/sys/dev/sfxge/common/siena_nvram.c
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_ev.c  Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/efx_ev.c  Sun Feb 22 07:08:57 2015        
(r279141)
@@ -654,7 +654,7 @@ out:
        return (should_abort);
 }
 
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
 
        __checkReturn   int
 efx_ev_qprime(
@@ -970,7 +970,7 @@ efx_ev_qcreate(
        eep->ee_handler[FSE_AZ_EV_CODE_DRV_GEN_EV] = efx_ev_drv_gen;
 #if EFSYS_OPT_MCDI
        eep->ee_handler[FSE_AZ_EV_CODE_MCDI_EVRESPONSE] = efx_ev_mcdi;
-#endif /* EFSYS_OPT_SIENA */
+#endif /* EFSYS_OPT_MCDI */
 
        /* Set up the new event queue */
        if (enp->en_family != EFX_FAMILY_FALCON) {

Modified: head/sys/dev/sfxge/common/efx_filter.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_filter.c      Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/efx_filter.c      Sun Feb 22 07:08:57 2015        
(r279141)
@@ -412,7 +412,7 @@ efx_filter_search(
        __in            uint32_t key,
        __in            boolean_t for_insert,
        __out           int *filter_index,
-       __out           int *depth_required)
+       __out           unsigned int *depth_required)
 {
        unsigned hash, incr, filter_idx, depth;
 
@@ -528,7 +528,8 @@ efx_filter_remove_filter(
        efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
        efx_filter_spec_t *saved_spec;
        efx_oword_t filter;
-       int filter_idx, depth;
+       int filter_idx;
+       unsigned int depth;
        int state;
        uint32_t key;
        int rc;
@@ -561,7 +562,7 @@ efx_filter_remove_index(
        __in            int index)
 {
        efx_filter_t *efp = &enp->en_filter;
-       enum efx_filter_tbl_id tbl_id = efx_filter_tbl_id(type);
+       efx_filter_tbl_id_t tbl_id = efx_filter_tbl_id(type);
        efx_filter_tbl_t *eftp = &efp->ef_tbl[tbl_id];
        int state;
 

Modified: head/sys/dev/sfxge/common/efx_mcdi.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_mcdi.c        Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/efx_mcdi.c        Sun Feb 22 07:08:57 2015        
(r279141)
@@ -532,7 +532,7 @@ efx_mcdi_version(
 
 version:
        /* The bootrom doesn't understand BOOT_STATUS */
-       if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_BOOTROM) {
+       if (build == MC_CMD_GET_VERSION_OUT_FIRMWARE_SIENA_BOOTROM) {
                status = EFX_MCDI_BOOT_ROM;
                goto out;
        }

Modified: head/sys/dev/sfxge/common/efx_nic.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_nic.c Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/efx_nic.c Sun Feb 22 07:08:57 2015        
(r279141)
@@ -249,10 +249,13 @@ efx_nic_create(
 #if EFSYS_OPT_SIENA
        case EFX_FAMILY_SIENA:
                enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops;
-               enp->en_features = EFX_FEATURE_IPV6 |
+               enp->en_features =
+                   EFX_FEATURE_IPV6 |
                    EFX_FEATURE_LFSR_HASH_INSERT |
-                   EFX_FEATURE_LINK_EVENTS | EFX_FEATURE_PERIODIC_MAC_STATS |
-                   EFX_FEATURE_WOL | EFX_FEATURE_MCDI |
+                   EFX_FEATURE_LINK_EVENTS |
+                   EFX_FEATURE_PERIODIC_MAC_STATS |
+                   EFX_FEATURE_WOL |
+                   EFX_FEATURE_MCDI |
                    EFX_FEATURE_LOOKAHEAD_SPLIT |
                    EFX_FEATURE_MAC_HEADER_FILTERS;
                break;

Modified: head/sys/dev/sfxge/common/efx_tx.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_tx.c  Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/efx_tx.c  Sun Feb 22 07:08:57 2015        
(r279141)
@@ -289,8 +289,9 @@ efx_tx_qcreate(
        EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
        EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
 
-       EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == (1 << 
FRF_AZ_TX_DESCQ_LABEL_WIDTH));
-       /*      EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);*/
+       EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS ==
+           (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH));
+       EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);
        EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit);
 
        if (!ISP2(n) || !(n & EFX_TXQ_NDESCS_MASK)) {

Modified: head/sys/dev/sfxge/common/siena_mac.c
==============================================================================
--- head/sys/dev/sfxge/common/siena_mac.c       Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/siena_mac.c       Sun Feb 22 07:08:57 2015        
(r279141)
@@ -534,6 +534,7 @@ siena_mac_stats_update(
                            &generation_start);
 
        /* Check that we didn't read the stats in the middle of a DMA */
+       /* Not a good enough check ? */
        if (memcmp(&generation_start, &generation_end,
            sizeof (generation_start)))
                return (EAGAIN);

Modified: head/sys/dev/sfxge/common/siena_nic.c
==============================================================================
--- head/sys/dev/sfxge/common/siena_nic.c       Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/siena_nic.c       Sun Feb 22 07:08:57 2015        
(r279141)
@@ -478,7 +478,7 @@ siena_phy_cfg(
        if (MCDI_OUT_DWORD_FIELD(req, GET_PHY_CFG_OUT_FLAGS,
            GET_PHY_CFG_OUT_BIST))
                encp->enc_bist_mask |= (1 << EFX_PHY_BIST_TYPE_NORMAL);
-#endif /* EFSYS_OPT_BIST */
+#endif /* EFSYS_OPT_PHY_BIST */
 
        return (0);
 
@@ -610,7 +610,6 @@ siena_nic_probe(
        unsigned int mask;
        int rc;
 
-       mask = 0;       /* XXX: pacify gcc */
        EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
 
        /* Read clear any assertion state */

Modified: head/sys/dev/sfxge/common/siena_nvram.c
==============================================================================
--- head/sys/dev/sfxge/common/siena_nvram.c     Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/common/siena_nvram.c     Sun Feb 22 07:08:57 2015        
(r279141)
@@ -612,7 +612,7 @@ siena_nvram_get_subtype(
 
        if (req.emr_out_length_used <
            MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST +
-           (partn + 1) * sizeof(efx_word_t)) {
+           (partn + 1) * sizeof (efx_word_t)) {
                rc = ENOENT;
                goto fail3;
        }

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c       Sun Feb 22 06:22:10 2015        
(r279140)
+++ head/sys/dev/sfxge/sfxge_tx.c       Sun Feb 22 07:08:57 2015        
(r279141)
@@ -505,7 +505,7 @@ sfxge_tx_qdpl_service(struct sfxge_txq *
  * list", otherwise we atomically push it on the "put list".  The swizzle
  * function takes care of ordering.
  *
- * The length of the put list is bounded by SFXGE_TX_MAX_DEFFERED.  We
+ * The length of the put list is bounded by SFXGE_TX_MAX_DEFERRED.  We
  * overload the csum_data field in the mbuf to keep track of this length
  * because there is no cheap alternative to avoid races.
  */
@@ -569,7 +569,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq,
 
 /*
  * Called from if_transmit - will try to grab the txq lock and enqueue to the
- * put list if it succeeds, otherwise will push onto the defer list.
+ * put list if it succeeds, otherwise try to push onto the defer list if space.
  */
 int
 sfxge_tx_packet_add(struct sfxge_txq *txq, struct mbuf *m)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to