aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2010-08-17 04:59:14 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 03:08:30 -0400
commit2244d07bfa2097cb00600da91c715a8aa547917e (patch)
tree44d67d9ffba3697fffeb05c13e88aa76ebc3fd4a /drivers/net/bfin_mac.c
parent4d5870ec103e6569851b9710f0093f072b08439a (diff)
net: simplify flags for tx timestamping
This patch removes the abstraction introduced by the union skb_shared_tx in the shared skb data. The access of the different union elements at several places led to some confusion about accessing the shared tx_flags e.g. in skb_orphan_try(). http://marc.info/?l=linux-netdev&m=128084897415886&w=2 Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r--drivers/net/bfin_mac.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 012613fde3f4..7a0e4156fade 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -803,15 +803,14 @@ static void bfin_dump_hwtamp(char *s, ktime_t *hw, ktime_t *ts, struct timecompa
803static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb) 803static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb)
804{ 804{
805 struct bfin_mac_local *lp = netdev_priv(netdev); 805 struct bfin_mac_local *lp = netdev_priv(netdev);
806 union skb_shared_tx *shtx = skb_tx(skb);
807 806
808 if (shtx->hardware) { 807 if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
809 int timeout_cnt = MAX_TIMEOUT_CNT; 808 int timeout_cnt = MAX_TIMEOUT_CNT;
810 809
811 /* When doing time stamping, keep the connection to the socket 810 /* When doing time stamping, keep the connection to the socket
812 * a while longer 811 * a while longer
813 */ 812 */
814 shtx->in_progress = 1; 813 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
815 814
816 /* 815 /*
817 * The timestamping is done at the EMAC module's MII/RMII interface 816 * The timestamping is done at the EMAC module's MII/RMII interface
@@ -991,7 +990,6 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
991 struct bfin_mac_local *lp = netdev_priv(dev); 990 struct bfin_mac_local *lp = netdev_priv(dev);
992 u16 *data; 991 u16 *data;
993 u32 data_align = (unsigned long)(skb->data) & 0x3; 992 u32 data_align = (unsigned long)(skb->data) & 0x3;
994 union skb_shared_tx *shtx = skb_tx(skb);
995 993
996 current_tx_ptr->skb = skb; 994 current_tx_ptr->skb = skb;
997 995
@@ -1005,7 +1003,7 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
1005 * of this field are the length of the packet payload in bytes and the higher 1003 * of this field are the length of the packet payload in bytes and the higher
1006 * 4 bits are the timestamping enable field. 1004 * 4 bits are the timestamping enable field.
1007 */ 1005 */
1008 if (shtx->hardware) 1006 if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
1009 *data |= 0x1000; 1007 *data |= 0x1000;
1010 1008
1011 current_tx_ptr->desc_a.start_addr = (u32)data; 1009 current_tx_ptr->desc_a.start_addr = (u32)data;
@@ -1015,7 +1013,7 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
1015 } else { 1013 } else {
1016 *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len); 1014 *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len);
1017 /* enable timestamping for the sent packet */ 1015 /* enable timestamping for the sent packet */
1018 if (shtx->hardware) 1016 if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
1019 *((u16 *)(current_tx_ptr->packet)) |= 0x1000; 1017 *((u16 *)(current_tx_ptr->packet)) |= 0x1000;
1020 memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data, 1018 memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data,
1021 skb->len); 1019 skb->len);