Commit 057d32f0 authored by Bing Zhao's avatar Bing Zhao Committed by John W. Linville

Revert "mwifiex: Use the proper interfaces"

This reverts commit a82fc3b4a2bceb7c6587249cb690342eb5065979.

Thomas corrected me on that I misunderstood Johannes' comment
for net_timedelta() and the ktime_get_real() usage inside
__net_timestamp().

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ad362984
...@@ -121,6 +121,7 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len) ...@@ -121,6 +121,7 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
u16 pkt_len; u16 pkt_len;
u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT; u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT;
struct timeval tv;
pkt_len = len + ETH_ALEN; pkt_len = len + ETH_ALEN;
...@@ -142,7 +143,8 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len) ...@@ -142,7 +143,8 @@ mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
len - sizeof(struct ieee80211_hdr_3addr)); len - sizeof(struct ieee80211_hdr_3addr));
skb->priority = LOW_PRIO_TID; skb->priority = LOW_PRIO_TID;
__net_timestamp(skb); do_gettimeofday(&tv);
skb->tstamp = timeval_to_ktime(tv);
return 0; return 0;
} }
......
...@@ -609,6 +609,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -609,6 +609,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
struct sk_buff *new_skb; struct sk_buff *new_skb;
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
struct timeval tv;
dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n", dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n",
jiffies, priv->bss_type, priv->bss_num); jiffies, priv->bss_type, priv->bss_num);
...@@ -655,7 +656,8 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -655,7 +656,8 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
* firmware for aggregate delay calculation for stats and * firmware for aggregate delay calculation for stats and
* MSDU lifetime expiry. * MSDU lifetime expiry.
*/ */
__net_timestamp(skb); do_gettimeofday(&tv);
skb->tstamp = timeval_to_ktime(tv);
mwifiex_queue_tx_pkt(priv, skb); mwifiex_queue_tx_pkt(priv, skb);
......
...@@ -530,6 +530,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, ...@@ -530,6 +530,7 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
struct timeval tv;
int ret; int ret;
u16 skb_len; u16 skb_len;
...@@ -607,7 +608,8 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, ...@@ -607,7 +608,8 @@ int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer,
tx_info->bss_num = priv->bss_num; tx_info->bss_num = priv->bss_num;
tx_info->bss_type = priv->bss_type; tx_info->bss_type = priv->bss_type;
__net_timestamp(skb); do_gettimeofday(&tv);
skb->tstamp = timeval_to_ktime(tv);
mwifiex_queue_tx_pkt(priv, skb); mwifiex_queue_tx_pkt(priv, skb);
return 0; return 0;
...@@ -700,6 +702,7 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, ...@@ -700,6 +702,7 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
struct timeval tv;
u8 *pos; u8 *pos;
u32 pkt_type, tx_control; u32 pkt_type, tx_control;
u16 pkt_len, skb_len; u16 pkt_len, skb_len;
...@@ -764,7 +767,8 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, ...@@ -764,7 +767,8 @@ int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer,
pkt_len = skb->len - MWIFIEX_MGMT_FRAME_HEADER_SIZE - sizeof(pkt_len); pkt_len = skb->len - MWIFIEX_MGMT_FRAME_HEADER_SIZE - sizeof(pkt_len);
memcpy(skb->data + MWIFIEX_MGMT_FRAME_HEADER_SIZE, &pkt_len, memcpy(skb->data + MWIFIEX_MGMT_FRAME_HEADER_SIZE, &pkt_len,
sizeof(pkt_len)); sizeof(pkt_len));
__net_timestamp(skb); do_gettimeofday(&tv);
skb->tstamp = timeval_to_ktime(tv);
mwifiex_queue_tx_pkt(priv, skb); mwifiex_queue_tx_pkt(priv, skb);
return 0; return 0;
......
...@@ -96,6 +96,7 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv, ...@@ -96,6 +96,7 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
struct sk_buff *new_skb; struct sk_buff *new_skb;
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
int hdr_chop; int hdr_chop;
struct timeval tv;
struct ethhdr *p_ethhdr; struct ethhdr *p_ethhdr;
uap_rx_pd = (struct uap_rxpd *)(skb->data); uap_rx_pd = (struct uap_rxpd *)(skb->data);
...@@ -191,7 +192,8 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv, ...@@ -191,7 +192,8 @@ static void mwifiex_uap_queue_bridged_pkt(struct mwifiex_private *priv,
tx_info->pkt_len = skb->len; tx_info->pkt_len = skb->len;
} }
__net_timestamp(skb); do_gettimeofday(&tv);
skb->tstamp = timeval_to_ktime(tv);
mwifiex_wmm_add_buf_txqueue(priv, skb); mwifiex_wmm_add_buf_txqueue(priv, skb);
atomic_inc(&adapter->tx_pending); atomic_inc(&adapter->tx_pending);
atomic_inc(&adapter->pending_bridged_pkts); atomic_inc(&adapter->pending_bridged_pkts);
......
...@@ -878,8 +878,15 @@ u8 ...@@ -878,8 +878,15 @@ u8
mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv,
const struct sk_buff *skb) const struct sk_buff *skb)
{ {
u32 queue_delay = ktime_to_ms(ktime_sub(ktime_get(), skb->tstamp));
u8 ret_val; u8 ret_val;
struct timeval out_tstamp, in_tstamp;
u32 queue_delay;
do_gettimeofday(&out_tstamp);
in_tstamp = ktime_to_timeval(skb->tstamp);
queue_delay = (out_tstamp.tv_sec - in_tstamp.tv_sec) * 1000;
queue_delay += (out_tstamp.tv_usec - in_tstamp.tv_usec) / 1000;
/* /*
* Queue delay is passed as a uint8 in units of 2ms (ms shifted * Queue delay is passed as a uint8 in units of 2ms (ms shifted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment