~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/bnx2x/bnx2x.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* bnx2x.h: Broadcom Everest network driver.
2
2
 *
3
 
 * Copyright (c) 2007-2010 Broadcom Corporation
 
3
 * Copyright (c) 2007-2011 Broadcom Corporation
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License as published by
22
22
 * (you will need to reboot afterwards) */
23
23
/* #define BNX2X_STOP_ON_ERROR */
24
24
 
25
 
#define DRV_MODULE_VERSION      "1.62.00-6"
26
 
#define DRV_MODULE_RELDATE      "2011/01/30"
 
25
#define DRV_MODULE_VERSION      "1.62.12-0"
 
26
#define DRV_MODULE_RELDATE      "2011/03/20"
27
27
#define BNX2X_BC_VER            0x040200
28
28
 
29
29
#define BNX2X_MULTI_QUEUE
31
31
#define BNX2X_NEW_NAPI
32
32
 
33
33
#if defined(CONFIG_DCB)
34
 
#define BCM_DCB
 
34
#define BCM_DCBNL
35
35
#endif
36
36
#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
37
37
#define BCM_CNIC 1
129
129
#endif
130
130
 
131
131
#define bnx2x_mc_addr(ha)      ((ha)->addr)
 
132
#define bnx2x_uc_addr(ha)      ((ha)->addr)
132
133
 
133
134
#define U64_LO(x)                       (u32)(((u64)(x)) & 0xffffffff)
134
135
#define U64_HI(x)                       (u32)(((u64)(x)) >> 32)
341
342
        /* chip independed shortcut into rx_prods_offset memory */
342
343
        u32                     ustorm_rx_prods_offset;
343
344
 
 
345
        u32                     rx_buf_size;
 
346
 
344
347
        dma_addr_t              status_blk_mapping;
345
348
 
346
349
        struct sw_tx_bd         *tx_buf_ring;
428
431
};
429
432
 
430
433
#define bnx2x_fp(bp, nr, var)           (bp->fp[nr].var)
 
434
 
 
435
/* Use 2500 as a mini-jumbo MTU for FCoE */
 
436
#define BNX2X_FCOE_MINI_JUMBO_MTU       2500
 
437
 
431
438
#ifdef BCM_CNIC
432
439
/* FCoE L2 `fastpath' is right after the eth entries */
433
440
#define FCOE_IDX                        BNX2X_NUM_ETH_QUEUES(bp)
466
473
#define NUM_RX_BD                       (RX_DESC_CNT * NUM_RX_RINGS)
467
474
#define MAX_RX_BD                       (NUM_RX_BD - 1)
468
475
#define MAX_RX_AVAIL                    (MAX_RX_DESC_CNT * NUM_RX_RINGS - 2)
469
 
#define MIN_RX_AVAIL                    128
 
476
#define MIN_RX_SIZE_TPA                 72
 
477
#define MIN_RX_SIZE_NONTPA              10
470
478
#define INIT_JUMBO_RX_RING_SIZE         MAX_RX_AVAIL
471
479
#define INIT_RX_RING_SIZE               MAX_RX_AVAIL
472
480
#define NEXT_RX_IDX(x)          ((((x) & RX_DESC_MASK) == \
810
818
        struct eth_stats_query          fw_stats;
811
819
        struct mac_configuration_cmd    mac_config;
812
820
        struct mac_configuration_cmd    mcast_config;
 
821
        struct mac_configuration_cmd    uc_mac_config;
813
822
        struct client_init_ramrod_data  client_init_data;
814
823
 
815
824
        /* used by dmae command executer */
885
894
        (&bp->def_status_blk->sp_sb.\
886
895
        index_values[HC_SP_INDEX_EQ_CONS])
887
896
 
 
897
/* This is a data that will be used to create a link report message.
 
898
 * We will keep the data used for the last link report in order
 
899
 * to prevent reporting the same link parameters twice.
 
900
 */
 
901
struct bnx2x_link_report_data {
 
902
        u16 line_speed;                 /* Effective line speed */
 
903
        unsigned long link_report_flags;/* BNX2X_LINK_REPORT_XXX flags */
 
904
};
 
905
 
 
906
enum {
 
907
        BNX2X_LINK_REPORT_FD,           /* Full DUPLEX */
 
908
        BNX2X_LINK_REPORT_LINK_DOWN,
 
909
        BNX2X_LINK_REPORT_RX_FC_ON,
 
910
        BNX2X_LINK_REPORT_TX_FC_ON,
 
911
};
 
912
 
888
913
struct bnx2x {
889
914
        /* Fields used in the tx and intr/napi performance paths
890
915
         * are grouped together in the beginning of the structure
910
935
 
911
936
        int                     tx_ring_size;
912
937
 
913
 
        u32                     rx_csum;
914
 
        u32                     rx_buf_size;
915
938
/* L2 header size + 2*VLANs (8 bytes) + LLC SNAP (8 bytes) */
916
939
#define ETH_OVREHEAD            (ETH_HLEN + 8 + 8)
917
940
#define ETH_MIN_PACKET_SIZE             60
939
962
        struct eth_spe          *spq_prod_bd;
940
963
        struct eth_spe          *spq_last_bd;
941
964
        __le16                  *dsb_sp_prod;
942
 
        atomic_t                spq_left; /* serialize spq */
 
965
        atomic_t                cq_spq_left; /* ETH_XXX ramrods credit */
943
966
        /* used to synchronize spq accesses */
944
967
        spinlock_t              spq_lock;
945
968
 
949
972
        u16                     eq_prod;
950
973
        u16                     eq_cons;
951
974
        __le16                  *eq_cons_sb;
 
975
        atomic_t                eq_spq_left; /* COMMON_XXX ramrods credit */
952
976
 
953
977
        /* Flags for marking that there is a STAT_QUERY or
954
978
           SET_MAC ramrod pending */
976
1000
#define MF_FUNC_DIS                     0x1000
977
1001
#define FCOE_MACS_SET                   0x2000
978
1002
#define NO_FCOE_FLAG                    0x4000
 
1003
#define NO_ISCSI_OOO_FLAG               0x8000
 
1004
#define NO_ISCSI_FLAG                   0x10000
979
1005
 
980
1006
#define NO_FCOE(bp)             ((bp)->flags & NO_FCOE_FLAG)
 
1007
#define NO_ISCSI(bp)            ((bp)->flags & NO_ISCSI_FLAG)
 
1008
#define NO_ISCSI_OOO(bp)        ((bp)->flags & NO_ISCSI_OOO_FLAG)
981
1009
 
982
1010
        int                     pf_num; /* absolute PF number */
983
1011
        int                     pfid;   /* per-path PF number */
1014
1042
 
1015
1043
        struct link_params      link_params;
1016
1044
        struct link_vars        link_vars;
 
1045
        u32                     link_cnt;
 
1046
        struct bnx2x_link_report_data last_reported_link;
 
1047
 
1017
1048
        struct mdio_if_info     mdio;
1018
1049
 
1019
1050
        struct bnx2x_common     common;
1064
1095
        int                     num_queues;
1065
1096
        int                     disable_tpa;
1066
1097
        int                     int_mode;
 
1098
        u32                     *rx_indir_table;
1067
1099
 
1068
1100
        struct tstorm_eth_mac_filter_config     mac_filters;
1069
1101
#define BNX2X_ACCEPT_NONE               0x0000
1110
1142
#define BNX2X_CNIC_FLAG_MAC_SET         1
1111
1143
        void                    *t2;
1112
1144
        dma_addr_t              t2_mapping;
1113
 
        struct cnic_ops         *cnic_ops;
 
1145
        struct cnic_ops __rcu   *cnic_ops;
1114
1146
        void                    *cnic_data;
1115
1147
        u32                     cnic_tag;
1116
1148
        struct cnic_eth_dev     cnic_eth_dev;
1125
1157
        u16                     cnic_kwq_pending;
1126
1158
        u16                     cnic_spq_pending;
1127
1159
        struct mutex            cnic_mutex;
1128
 
        u8                      iscsi_mac[ETH_ALEN];
1129
1160
        u8                      fip_mac[ETH_ALEN];
1130
1161
#endif
1131
1162
 
1132
1163
        int                     dmae_ready;
1133
1164
        /* used to synchronize dmae accesses */
1134
 
        struct mutex            dmae_mutex;
 
1165
        spinlock_t              dmae_lock;
1135
1166
 
1136
1167
        /* used to protect the FW mail box */
1137
1168
        struct mutex            fw_mb_mutex;
1208
1239
        struct bnx2x_dcbx_port_params           dcbx_port_params;
1209
1240
        int                                     dcb_version;
1210
1241
 
1211
 
        /* DCBX Negotation results */
 
1242
        /* DCBX Negotiation results */
1212
1243
        struct dcbx_features                    dcbx_local_feat;
1213
1244
        u32                                     dcbx_error;
 
1245
#ifdef BCM_DCBNL
 
1246
        struct dcbx_features                    dcbx_remote_feat;
 
1247
        u32                                     dcbx_remote_flags;
 
1248
#endif
1214
1249
        u32                                     pending_max;
1215
1250
};
1216
1251
 
1430
1465
#define WAIT_RAMROD_POLL        0x01
1431
1466
#define WAIT_RAMROD_COMMON      0x02
1432
1467
 
 
1468
void bnx2x_read_mf_cfg(struct bnx2x *bp);
 
1469
 
1433
1470
/* dmae */
1434
1471
void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32);
1435
1472
void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr,
1448
1485
void bnx2x_calc_fc_adv(struct bnx2x *bp);
1449
1486
int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,
1450
1487
                  u32 data_hi, u32 data_lo, int common);
 
1488
 
 
1489
/* Clears multicast and unicast list configuration in the chip. */
 
1490
void bnx2x_invalidate_e1_mc_list(struct bnx2x *bp);
 
1491
void bnx2x_invalidate_e1h_mc_list(struct bnx2x *bp);
 
1492
void bnx2x_invalidate_uc_list(struct bnx2x *bp);
 
1493
 
1451
1494
void bnx2x_update_coalesce(struct bnx2x *bp);
1452
1495
int bnx2x_get_link_cfg_idx(struct bnx2x *bp);
1453
1496
 
1787
1830
BNX2X_EXTERN int load_count[2][3]; /* per path: 0-common, 1-port0, 2-port1 */
1788
1831
 
1789
1832
extern void bnx2x_set_ethtool_ops(struct net_device *netdev);
 
1833
void bnx2x_push_indir_table(struct bnx2x *bp);
1790
1834
 
1791
1835
#endif /* bnx2x.h */