diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/chelsio/common.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/chelsio/common.h')
-rw-r--r-- | drivers/net/chelsio/common.h | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index 699d22c5fe09..036b2dfb1d40 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h | |||
@@ -36,6 +36,8 @@ | |||
36 | * * | 36 | * * |
37 | ****************************************************************************/ | 37 | ****************************************************************************/ |
38 | 38 | ||
39 | #define pr_fmt(fmt) "cxgb: " fmt | ||
40 | |||
39 | #ifndef _CXGB_COMMON_H_ | 41 | #ifndef _CXGB_COMMON_H_ |
40 | #define _CXGB_COMMON_H_ | 42 | #define _CXGB_COMMON_H_ |
41 | 43 | ||
@@ -49,34 +51,13 @@ | |||
49 | #include <linux/mdio.h> | 51 | #include <linux/mdio.h> |
50 | #include <linux/crc32.h> | 52 | #include <linux/crc32.h> |
51 | #include <linux/init.h> | 53 | #include <linux/init.h> |
54 | #include <linux/slab.h> | ||
52 | #include <asm/io.h> | 55 | #include <asm/io.h> |
53 | #include <linux/pci_ids.h> | 56 | #include <linux/pci_ids.h> |
54 | 57 | ||
55 | #define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" | 58 | #define DRV_DESCRIPTION "Chelsio 10Gb Ethernet Driver" |
56 | #define DRV_NAME "cxgb" | 59 | #define DRV_NAME "cxgb" |
57 | #define DRV_VERSION "2.2" | 60 | #define DRV_VERSION "2.2" |
58 | #define PFX DRV_NAME ": " | ||
59 | |||
60 | #define CH_ERR(fmt, ...) printk(KERN_ERR PFX fmt, ## __VA_ARGS__) | ||
61 | #define CH_WARN(fmt, ...) printk(KERN_WARNING PFX fmt, ## __VA_ARGS__) | ||
62 | #define CH_ALERT(fmt, ...) printk(KERN_ALERT PFX fmt, ## __VA_ARGS__) | ||
63 | |||
64 | /* | ||
65 | * More powerful macro that selectively prints messages based on msg_enable. | ||
66 | * For info and debugging messages. | ||
67 | */ | ||
68 | #define CH_MSG(adapter, level, category, fmt, ...) do { \ | ||
69 | if ((adapter)->msg_enable & NETIF_MSG_##category) \ | ||
70 | printk(KERN_##level PFX "%s: " fmt, (adapter)->name, \ | ||
71 | ## __VA_ARGS__); \ | ||
72 | } while (0) | ||
73 | |||
74 | #ifdef DEBUG | ||
75 | # define CH_DBG(adapter, category, fmt, ...) \ | ||
76 | CH_MSG(adapter, DEBUG, category, fmt, ## __VA_ARGS__) | ||
77 | #else | ||
78 | # define CH_DBG(fmt, ...) | ||
79 | #endif | ||
80 | 61 | ||
81 | #define CH_DEVICE(devid, ssid, idx) \ | 62 | #define CH_DEVICE(devid, ssid, idx) \ |
82 | { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } | 63 | { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx } |
@@ -90,25 +71,13 @@ | |||
90 | typedef struct adapter adapter_t; | 71 | typedef struct adapter adapter_t; |
91 | 72 | ||
92 | struct t1_rx_mode { | 73 | struct t1_rx_mode { |
93 | struct net_device *dev; | 74 | struct net_device *dev; |
94 | u32 idx; | ||
95 | struct dev_mc_list *list; | ||
96 | }; | 75 | }; |
97 | 76 | ||
98 | #define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC) | 77 | #define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC) |
99 | #define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI) | 78 | #define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI) |
100 | #define t1_rx_mode_mc_cnt(rm) (rm->dev->mc_count) | 79 | #define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev)) |
101 | 80 | #define t1_get_netdev(rm) (rm->dev) | |
102 | static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm) | ||
103 | { | ||
104 | u8 *addr = NULL; | ||
105 | |||
106 | if (rm->idx++ < rm->dev->mc_count) { | ||
107 | addr = rm->list->dmi_addr; | ||
108 | rm->list = rm->list->next; | ||
109 | } | ||
110 | return addr; | ||
111 | } | ||
112 | 81 | ||
113 | #define MAX_NPORTS 4 | 82 | #define MAX_NPORTS 4 |
114 | #define PORT_MASK ((1 << MAX_NPORTS) - 1) | 83 | #define PORT_MASK ((1 << MAX_NPORTS) - 1) |
@@ -334,7 +303,7 @@ static inline int t1_is_asic(const adapter_t *adapter) | |||
334 | return adapter->params.is_asic; | 303 | return adapter->params.is_asic; |
335 | } | 304 | } |
336 | 305 | ||
337 | extern struct pci_device_id t1_pci_tbl[]; | 306 | extern const struct pci_device_id t1_pci_tbl[]; |
338 | 307 | ||
339 | static inline int adapter_matches_type(const adapter_t *adapter, | 308 | static inline int adapter_matches_type(const adapter_t *adapter, |
340 | int version, int revision) | 309 | int version, int revision) |