summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/baseband.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2020-04-19 14:43:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 13:33:36 +0200
commit3436accadc3f179a108071df552a6b82542523b1 (patch)
tree504a5e4622e0731100e6bdcf95e35baead4f07d1 /drivers/staging/vt6656/baseband.c
parent6f21cb793ce209e4e2ae020e06e0a39b9a8bf2c0 (diff)
staging: vt6656: Move vnt_get_frame_time and vnt_get_phy_field to rxtx
These functions are only used by rxtx so move them and their arrays used with them abbreviating the function description. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/2a4fd665-2fe1-f1ad-1e9a-1b01f698ea79@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/baseband.c')
-rw-r--r--drivers/staging/vt6656/baseband.c139
1 files changed, 0 insertions, 139 deletions
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index d21a9cf0afe5..e7000bba644a 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -112,10 +112,6 @@ static u8 vnt_vt3184_vt3226d0[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xff */
};
-static const u16 vnt_frame_time[MAX_RATE] = {
- 10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216
-};
-
struct vnt_threshold {
u8 bb_pre_ed_rssi;
u8 cr_201;
@@ -196,141 +192,6 @@ static const struct vnt_threshold vt3342_vnt_threshold[] = {
{41, 0xff, 0x00}
};
-static const u8 vnt_phy_signal[] = {
- 0x00, /* RATE_1M */
- 0x01, /* RATE_2M */
- 0x02, /* RATE_5M */
- 0x03, /* RATE_11M */
- 0x8b, /* RATE_6M */
- 0x8f, /* RATE_9M */
- 0x8a, /* RATE_12M */
- 0x8e, /* RATE_18M */
- 0x89, /* RATE_24M */
- 0x8d, /* RATE_36M */
- 0x88, /* RATE_48M */
- 0x8c /* RATE_54M */
-};
-
-/*
- * Description: Calculate data frame transmitting time
- *
- * Parameters:
- * In:
- * preamble_type - Preamble Type
- * pkt_type - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
- * frame_length - Baseband Type
- * tx_rate - Tx Rate
- * Out:
- *
- * Return Value: FrameTime
- *
- */
-unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type,
- unsigned int frame_length, u16 tx_rate)
-{
- unsigned int frame_time;
- unsigned int preamble;
- unsigned int rate;
-
- if (tx_rate > RATE_54M)
- return 0;
-
- rate = (unsigned int)vnt_frame_time[tx_rate];
-
- if (tx_rate <= RATE_11M) {
- if (preamble_type == PREAMBLE_SHORT)
- preamble = 96;
- else
- preamble = 192;
-
- frame_time = DIV_ROUND_UP(frame_length * 80, rate);
- return preamble + frame_time;
- }
-
- frame_time = DIV_ROUND_UP(frame_length * 8 + 22, rate);
- frame_time = frame_time * 4;
-
- if (pkt_type != PK_TYPE_11A)
- frame_time += 6;
- return 20 + frame_time;
-}
-
-/*
- * Description: Calculate Length, Service, and Signal fields of Phy for Tx
- *
- * Parameters:
- * In:
- * priv - Device Structure
- * frame_length - Tx Frame Length
- * tx_rate - Tx Rate
- * Out:
- * struct vnt_phy_field *phy
- * - pointer to Phy Length field
- * - pointer to Phy Service field
- * - pointer to Phy Signal field
- *
- * Return Value: none
- *
- */
-void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
- u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy)
-{
- u32 bit_count;
- u32 count = 0;
- u32 tmp;
- int ext_bit;
- int i;
- u8 mask = 0;
- u8 preamble_type = priv->preamble_type;
-
- bit_count = frame_length * 8;
- ext_bit = false;
-
- switch (tx_rate) {
- case RATE_1M:
- count = bit_count;
- break;
- case RATE_2M:
- count = bit_count / 2;
- break;
- case RATE_5M:
- count = DIV_ROUND_UP(bit_count * 10, 55);
- break;
- case RATE_11M:
- count = bit_count / 11;
- tmp = count * 11;
-
- if (tmp != bit_count) {
- count++;
-
- if ((bit_count - tmp) <= 3)
- ext_bit = true;
- }
-
- break;
- }
-
- if (tx_rate > RATE_11M) {
- if (pkt_type == PK_TYPE_11A)
- mask = BIT(4);
- } else if (tx_rate > RATE_1M) {
- if (preamble_type == PREAMBLE_SHORT)
- mask = BIT(3);
- }
-
- i = tx_rate > RATE_54M ? RATE_54M : tx_rate;
- phy->signal = vnt_phy_signal[i] | mask;
- phy->service = 0x00;
-
- if (pkt_type == PK_TYPE_11B) {
- if (ext_bit)
- phy->service |= 0x80;
- phy->len = cpu_to_le16((u16)count);
- } else {
- phy->len = cpu_to_le16((u16)frame_length);
- }
-}
-
/*
* Description: Set Antenna mode
*