mirror of
https://github.com/open-sdr/openwifi.git
synced 2025-04-10 12:19:56 +00:00
Merge branch 'pre-release' of github.com:open-sdr/openwifi into pre-release
This commit is contained in:
commit
9f3a7b7fcf
23
driver/sdr.c
23
driver/sdr.c
@ -911,15 +911,20 @@ static void openwifi_tx(struct ieee80211_hw *dev,
|
||||
{
|
||||
// psdu = [ MPDU ]
|
||||
len_psdu = len_mpdu;
|
||||
|
||||
addr1_low32_prev = -1;
|
||||
addr1_high16_prev = -1;
|
||||
duration_id_prev = -1;
|
||||
use_short_gi_prev = -1;
|
||||
rate_hw_value_prev = -1;
|
||||
prio_prev = -1;
|
||||
retry_limit_raw_prev = -1;
|
||||
pkt_need_ack_prev = -1;
|
||||
|
||||
// // Don't need to reset _prev variables every time when it is not ht aggr qos data. Reason:
|
||||
// // 1. In 99.9999% cases, the ht always use qos data and goes to prio/queue_idx 2. By not resetting the variable to -1, we can have continuous aggregation packet operation in FPGA queue 2.
|
||||
// // 2. In other words, the aggregation operation for queue 2 in FPGA won't be interrupted by other non aggregation packets (control/management/beacon/etc.) that go to queue 0 (or other queues than 2).
|
||||
// // 3. From wired domain and upper level ( DSCP, AC (0~3), WMM management, 802.11D service classes and user priority (UP) ) to chip/FPGA queue index, thre should be some (complicated) mapping relationship.
|
||||
// // 4. More decent design is setting these aggregation flags (ht_aggr_start) per queue/prio here in driver. But since now only queue 2 and 0 are used (data goes to queue 2, others go to queue 0) in normal (most) cases, let's not go to the decent (complicated) solution immediately.
|
||||
// addr1_low32_prev = -1;
|
||||
// addr1_high16_prev = -1;
|
||||
// duration_id_prev = -1;
|
||||
// use_short_gi_prev = -1;
|
||||
// rate_hw_value_prev = -1;
|
||||
// prio_prev = -1;
|
||||
// retry_limit_raw_prev = -1;
|
||||
// pkt_need_ack_prev = -1;
|
||||
}
|
||||
num_dma_symbol = (len_psdu>>TX_INTF_NUM_BYTE_PER_DMA_SYMBOL_IN_BITS) + ((len_psdu&(TX_INTF_NUM_BYTE_PER_DMA_SYMBOL-1))!=0);
|
||||
|
||||
|
@ -416,7 +416,7 @@ static inline u32 hw_init(enum xpu_mode mode){
|
||||
}
|
||||
xpu_api->XPU_REG_BAND_CHANNEL_write((false<<24)|(BAND_5_8GHZ<<16)|44);//use_short_slot==false; 5.8GHz; channel 44 -- default setting to sync with priv->band/channel/use_short_slot
|
||||
|
||||
agc_gain_delay = 50; //samples
|
||||
agc_gain_delay = 39; //samples
|
||||
rssi_half_db_offset = 75<<1;
|
||||
xpu_api->XPU_REG_RSSI_DB_CFG_write(0x80000000|((rssi_half_db_offset<<16)|agc_gain_delay) );
|
||||
xpu_api->XPU_REG_RSSI_DB_CFG_write((~0x80000000)&((rssi_half_db_offset<<16)|agc_gain_delay) );
|
||||
@ -433,13 +433,43 @@ static inline u32 hw_init(enum xpu_mode mode){
|
||||
// xpu_api->XPU_REG_CSMA_CFG_write(268435459); // Linux will do config for each queue via openwifi_conf_tx
|
||||
// xpu_api->XPU_REG_CSMA_CFG_write(0xe0000000); // Linux will do config for each queue via openwifi_conf_tx
|
||||
|
||||
xpu_api->XPU_REG_SEND_ACK_WAIT_TOP_write( ((51)<<16)|0 );//now our tx send out I/Q immediately
|
||||
xpu_api->XPU_REG_SEND_ACK_WAIT_TOP_write( ((16+23)<<16)|(0+23) );
|
||||
|
||||
xpu_api->XPU_REG_RECV_ACK_COUNT_TOP0_write( (((45+2+2)*10 + 15)<<16) | 10 );//2.4GHz. extra 300 clocks are needed when rx core fall into fake ht detection phase (rx mcs 6M)
|
||||
xpu_api->XPU_REG_RECV_ACK_COUNT_TOP1_write( (((51+2+2)*10 + 15)<<16) | 10 );//5GHz. extra 300 clocks are needed when rx core fall into fake ht detection phase (rx mcs 6M)
|
||||
xpu_api->XPU_REG_RECV_ACK_COUNT_TOP0_write( (1<<31) | (((45+2+2)*10 + 15)<<16) | 10 );//2.4GHz. extra 300 clocks are needed when rx core fall into fake ht detection phase (rx mcs 6M)
|
||||
xpu_api->XPU_REG_RECV_ACK_COUNT_TOP1_write( (1<<31) | (((51+2+2)*10 + 15)<<16) | 10 );//5GHz. extra 300 clocks are needed when rx core fall into fake ht detection phase (rx mcs 6M)
|
||||
|
||||
xpu_api->XPU_REG_DIFS_ADVANCE_write((OPENWIFI_MAX_SIGNAL_LEN_TH<<16)|2); //us. bit31~16 max pkt length threshold
|
||||
|
||||
// setup time schedule of 4 slices
|
||||
// slice 0
|
||||
xpu_api->XPU_REG_SLICE_COUNT_TOTAL_write(50000-1); // total 50ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_START_write(0); //start 0ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_END_write(50000-1); //end 50ms
|
||||
|
||||
// slice 1
|
||||
xpu_api->XPU_REG_SLICE_COUNT_TOTAL_write((1<<20)|(50000-1)); // total 50ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_START_write((1<<20)|(0)); //start 0ms
|
||||
//xpu_api->XPU_REG_SLICE_COUNT_END_write((1<<20)|(20000-1)); //end 20ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_END_write((1<<20)|(50000-1)); //end 20ms
|
||||
|
||||
// slice 2
|
||||
xpu_api->XPU_REG_SLICE_COUNT_TOTAL_write((2<<20)|(50000-1)); // total 50ms
|
||||
//xpu_api->XPU_REG_SLICE_COUNT_START_write((2<<20)|(20000)); //start 20ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_START_write((2<<20)|(0)); //start 20ms
|
||||
//xpu_api->XPU_REG_SLICE_COUNT_END_write((2<<20)|(40000-1)); //end 20ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_END_write((2<<20)|(50000-1)); //end 20ms
|
||||
|
||||
// slice 3
|
||||
xpu_api->XPU_REG_SLICE_COUNT_TOTAL_write((3<<20)|(50000-1)); // total 50ms
|
||||
//xpu_api->XPU_REG_SLICE_COUNT_START_write((3<<20)|(40000)); //start 40ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_START_write((3<<20)|(0)); //start 40ms
|
||||
//xpu_api->XPU_REG_SLICE_COUNT_END_write((3<<20)|(50000-1)); //end 20ms
|
||||
xpu_api->XPU_REG_SLICE_COUNT_END_write((3<<20)|(50000-1)); //end 20ms
|
||||
|
||||
// all slice sync rest
|
||||
xpu_api->XPU_REG_MULTI_RST_write(1<<7); //bit7 reset the counter for all queues at the same time
|
||||
xpu_api->XPU_REG_MULTI_RST_write(0<<7);
|
||||
|
||||
printk("%s hw_init err %d\n", xpu_compatible_str, err);
|
||||
return(err);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user