aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sungem.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-01 03:17:10 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-03 01:06:42 -0400
commitfe09bb619096a0aa139210748ddc668c2dbe2308 (patch)
tree6bc8488ee4941aeae05faf75d6522b491b4a24f1 /drivers/net/sungem.h
parent6f92c66f7190b1677ea666249b72298723392115 (diff)
sungem: Spring cleaning and GRO support
This patch simplifies the logic and locking in sungem significantly: - LLTX is gone, all private locks are gone, mutex is gone - We don't poll the PHY while the interface is down - The above allowed me to get rid of a pile of state flags using the proper interface state provided by the networking stack when needed and overall simplify the driver a lot - Allocate the bulk of RX skbs at init time using GFP_KERNEL - Fix a bug where the dev->features were set after register_netdev() - Added GRO while at it Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sungem.h')
-rw-r--r--drivers/net/sungem.h25
1 files changed, 0 insertions, 25 deletions
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h
index d225077964e2..835ce1b3cb9f 100644
--- a/drivers/net/sungem.h
+++ b/drivers/net/sungem.h
@@ -973,23 +973,14 @@ enum link_state {
973}; 973};
974 974
975struct gem { 975struct gem {
976 spinlock_t lock;
977 spinlock_t tx_lock;
978 void __iomem *regs; 976 void __iomem *regs;
979 int rx_new, rx_old; 977 int rx_new, rx_old;
980 int tx_new, tx_old; 978 int tx_new, tx_old;
981 979
982 unsigned int has_wol : 1; /* chip supports wake-on-lan */ 980 unsigned int has_wol : 1; /* chip supports wake-on-lan */
983 unsigned int asleep : 1; /* chip asleep, protected by pm_mutex */
984 unsigned int asleep_wol : 1; /* was asleep with WOL enabled */ 981 unsigned int asleep_wol : 1; /* was asleep with WOL enabled */
985 unsigned int opened : 1; /* driver opened, protected by pm_mutex */
986 unsigned int running : 1; /* chip running, protected by lock */
987 982
988 /* cell enable count, protected by lock */
989 int cell_enabled; 983 int cell_enabled;
990
991 struct mutex pm_mutex;
992
993 u32 msg_enable; 984 u32 msg_enable;
994 u32 status; 985 u32 status;
995 986
@@ -1033,20 +1024,4 @@ struct gem {
1033#define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) && \ 1024#define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) && \
1034 gp->phy_mii.def && gp->phy_mii.def->ops) 1025 gp->phy_mii.def && gp->phy_mii.def->ops)
1035 1026
1036#define ALIGNED_RX_SKB_ADDR(addr) \
1037 ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr))
1038static __inline__ struct sk_buff *gem_alloc_skb(int size,
1039 gfp_t gfp_flags)
1040{
1041 struct sk_buff *skb = alloc_skb(size + 64, gfp_flags);
1042
1043 if (skb) {
1044 int offset = (int) ALIGNED_RX_SKB_ADDR(skb->data);
1045 if (offset)
1046 skb_reserve(skb, offset);
1047 }
1048
1049 return skb;
1050}
1051
1052#endif /* _SUNGEM_H */ 1027#endif /* _SUNGEM_H */