]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / net / ethernet / chelsio / cxgb4 / cxgb4.h
index 0bce1bf9ca0fc587f84b8f2f5f8bd28227b22362..e88c1808e46f06e77671224d3a6a5edeb18ebc0d 100644 (file)
@@ -108,6 +108,12 @@ enum {
        PAUSE_AUTONEG = 1 << 2
 };
 
+enum {
+       FEC_AUTO      = 1 << 0,  /* IEEE 802.3 "automatic" */
+       FEC_RS        = 1 << 1,  /* Reed-Solomon */
+       FEC_BASER_RS  = 1 << 2   /* BaseR/Reed-Solomon */
+};
+
 struct port_stats {
        u64 tx_octets;            /* total # of octets in good frames */
        u64 tx_frames;            /* all good frames */
@@ -263,6 +269,11 @@ struct tp_params {
        u32 vlan_pri_map;               /* cached TP_VLAN_PRI_MAP */
        u32 ingress_config;             /* cached TP_INGRESS_CONFIG */
 
+       /* cached TP_OUT_CONFIG compressed error vector
+        * and passing outer header info for encapsulated packets.
+        */
+       int rx_pkt_encap;
+
        /* TP_VLAN_PRI_MAP Compressed Filter Tuple field offsets.  This is a
         * subset of the set of fields which may be present in the Compressed
         * Filter Tuple portion of filters and TCP TCB connections.  The
@@ -427,6 +438,9 @@ struct link_config {
        unsigned int   speed;            /* actual link speed */
        unsigned char  requested_fc;     /* flow control user has requested */
        unsigned char  fc;               /* actual link flow control */
+       unsigned char  auto_fec;         /* Forward Error Correction: */
+       unsigned char  requested_fec;    /* "automatic" (IEEE 802.3), */
+       unsigned char  fec;              /* requested, and actual in use */
        unsigned char  autoneg;          /* autonegotiating? */
        unsigned char  link_ok;          /* link up? */
        unsigned char  link_down_rc;     /* link down reason */
@@ -581,22 +595,6 @@ struct sge_rspq {                   /* state for an SGE response queue */
        rspq_handler_t handler;
        rspq_flush_handler_t flush_handler;
        struct t4_lro_mgr lro_mgr;
-#ifdef CONFIG_NET_RX_BUSY_POLL
-#define CXGB_POLL_STATE_IDLE           0
-#define CXGB_POLL_STATE_NAPI           BIT(0) /* NAPI owns this poll */
-#define CXGB_POLL_STATE_POLL           BIT(1) /* poll owns this poll */
-#define CXGB_POLL_STATE_NAPI_YIELD     BIT(2) /* NAPI yielded this poll */
-#define CXGB_POLL_STATE_POLL_YIELD     BIT(3) /* poll yielded this poll */
-#define CXGB_POLL_YIELD                        (CXGB_POLL_STATE_NAPI_YIELD |   \
-                                        CXGB_POLL_STATE_POLL_YIELD)
-#define CXGB_POLL_LOCKED               (CXGB_POLL_STATE_NAPI |         \
-                                        CXGB_POLL_STATE_POLL)
-#define CXGB_POLL_USER_PEND            (CXGB_POLL_STATE_POLL |         \
-                                        CXGB_POLL_STATE_POLL_YIELD)
-       unsigned int bpoll_state;
-       spinlock_t bpoll_lock;          /* lock for busy poll */
-#endif /* CONFIG_NET_RX_BUSY_POLL */
-
 };
 
 struct sge_eth_stats {              /* Ethernet queue statistics */
@@ -782,6 +780,10 @@ struct vf_info {
        bool pf_set_mac;
 };
 
+struct mbox_list {
+       struct list_head list;
+};
+
 struct adapter {
        void __iomem *regs;
        void __iomem *bar2;
@@ -844,6 +846,10 @@ struct adapter {
        struct work_struct db_drop_task;
        bool tid_release_task_busy;
 
+       /* lock for mailbox cmd list */
+       spinlock_t mbox_lock;
+       struct mbox_list mlist;
+
        /* support for mailbox command/reply logging */
 #define T4_OS_LOG_MBOX_CMDS 256
        struct mbox_cmd_log *mbox_log;
@@ -1160,102 +1166,6 @@ static inline struct adapter *netdev2adap(const struct net_device *dev)
        return netdev2pinfo(dev)->adapter;
 }
 
-#ifdef CONFIG_NET_RX_BUSY_POLL
-static inline void cxgb_busy_poll_init_lock(struct sge_rspq *q)
-{
-       spin_lock_init(&q->bpoll_lock);
-       q->bpoll_state = CXGB_POLL_STATE_IDLE;
-}
-
-static inline bool cxgb_poll_lock_napi(struct sge_rspq *q)
-{
-       bool rc = true;
-
-       spin_lock(&q->bpoll_lock);
-       if (q->bpoll_state & CXGB_POLL_LOCKED) {
-               q->bpoll_state |= CXGB_POLL_STATE_NAPI_YIELD;
-               rc = false;
-       } else {
-               q->bpoll_state = CXGB_POLL_STATE_NAPI;
-       }
-       spin_unlock(&q->bpoll_lock);
-       return rc;
-}
-
-static inline bool cxgb_poll_unlock_napi(struct sge_rspq *q)
-{
-       bool rc = false;
-
-       spin_lock(&q->bpoll_lock);
-       if (q->bpoll_state & CXGB_POLL_STATE_POLL_YIELD)
-               rc = true;
-       q->bpoll_state = CXGB_POLL_STATE_IDLE;
-       spin_unlock(&q->bpoll_lock);
-       return rc;
-}
-
-static inline bool cxgb_poll_lock_poll(struct sge_rspq *q)
-{
-       bool rc = true;
-
-       spin_lock_bh(&q->bpoll_lock);
-       if (q->bpoll_state & CXGB_POLL_LOCKED) {
-               q->bpoll_state |= CXGB_POLL_STATE_POLL_YIELD;
-               rc = false;
-       } else {
-               q->bpoll_state |= CXGB_POLL_STATE_POLL;
-       }
-       spin_unlock_bh(&q->bpoll_lock);
-       return rc;
-}
-
-static inline bool cxgb_poll_unlock_poll(struct sge_rspq *q)
-{
-       bool rc = false;
-
-       spin_lock_bh(&q->bpoll_lock);
-       if (q->bpoll_state & CXGB_POLL_STATE_POLL_YIELD)
-               rc = true;
-       q->bpoll_state = CXGB_POLL_STATE_IDLE;
-       spin_unlock_bh(&q->bpoll_lock);
-       return rc;
-}
-
-static inline bool cxgb_poll_busy_polling(struct sge_rspq *q)
-{
-       return q->bpoll_state & CXGB_POLL_USER_PEND;
-}
-#else
-static inline void cxgb_busy_poll_init_lock(struct sge_rspq *q)
-{
-}
-
-static inline bool cxgb_poll_lock_napi(struct sge_rspq *q)
-{
-       return true;
-}
-
-static inline bool cxgb_poll_unlock_napi(struct sge_rspq *q)
-{
-       return false;
-}
-
-static inline bool cxgb_poll_lock_poll(struct sge_rspq *q)
-{
-       return false;
-}
-
-static inline bool cxgb_poll_unlock_poll(struct sge_rspq *q)
-{
-       return false;
-}
-
-static inline bool cxgb_poll_busy_polling(struct sge_rspq *q)
-{
-       return false;
-}
-#endif /* CONFIG_NET_RX_BUSY_POLL */
-
 /* Return a version number to identify the type of adapter.  The scheme is:
  * - bits 0..9: chip version
  * - bits 10..15: chip revision
@@ -1283,8 +1193,6 @@ extern const char cxgb4_driver_version[];
 void t4_os_portmod_changed(const struct adapter *adap, int port_id);
 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
 
-void *t4_alloc_mem(size_t size);
-
 void t4_free_sge_resources(struct adapter *adap);
 void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
 irq_handler_t t4_intr_handler(struct adapter *adap);
@@ -1312,7 +1220,6 @@ irqreturn_t t4_sge_intr_msix(int irq, void *cookie);
 int t4_sge_init(struct adapter *adap);
 void t4_sge_start(struct adapter *adap);
 void t4_sge_stop(struct adapter *adap);
-int cxgb_busy_poll(struct napi_struct *napi);
 void cxgb4_set_ethtool_ops(struct net_device *netdev);
 int cxgb4_write_rss(const struct port_info *pi, const u16 *queues);
 extern int dbfifo_int_thresh;
@@ -1488,6 +1395,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info,
               const u8 *fw_data, unsigned int fw_size,
               struct fw_hdr *card_fw, enum dev_state state, int *reset);
 int t4_prep_adapter(struct adapter *adapter);
+int t4_shutdown_adapter(struct adapter *adapter);
 
 enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS };
 int t4_bar2_sge_qregs(struct adapter *adapter,
@@ -1656,7 +1564,6 @@ int t4_sched_params(struct adapter *adapter, int type, int level, int mode,
                    int rateunit, int ratemode, int channel, int class,
                    int minrate, int maxrate, int weight, int pktsize);
 void t4_sge_decode_idma_state(struct adapter *adapter, int state);
-void t4_free_mem(void *addr);
 void t4_idma_monitor_init(struct adapter *adapter,
                          struct sge_idma_monitor_state *idma);
 void t4_idma_monitor(struct adapter *adapter,