diff --git a/driver/make_all.sh b/driver/make_all.sh index 3085958..39163a0 100755 --- a/driver/make_all.sh +++ b/driver/make_all.sh @@ -53,6 +53,7 @@ set -x home_dir=$(pwd) cd $OPENWIFI_DIR/driver/ +echo "#define GIT_REV 0x"$(git log -1 --pretty=%h) > git_rev.h make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE cd $OPENWIFI_DIR/driver/openofdm_tx make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE diff --git a/driver/sdr.c b/driver/sdr.c index 40f8d99..5bdd765 100644 --- a/driver/sdr.c +++ b/driver/sdr.c @@ -52,6 +52,7 @@ #include "../user_space/sdrctl_src/nl80211_testmode_def.h" #include "hw_def.h" #include "sdr.h" +#include "git_rev.h" // driver API of component driver extern struct tx_intf_driver_api *tx_intf_api; @@ -312,7 +313,7 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id) struct ieee80211_rx_status rx_status = {0}; struct sk_buff *skb; struct ieee80211_hdr *hdr; - u32 addr1_low32=0, addr2_low32=0, addr3_low32=0, len, rate_idx, tsft_low, tsft_high, loop_count=0;//, ht_flag//;//, fc_di; + u32 addr1_low32=0, addr2_low32=0, addr3_low32=0, len, rate_idx, tsft_low, tsft_high, loop_count=0, ht_flag;//;//, fc_di; // u32 dma_driver_buf_idx_mod; u8 *pdata_tmp, fcs_ok, target_buf_idx;//, phy_rx_sn_hw; s8 signal; @@ -343,7 +344,7 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id) // phy_rx_sn_hw = (fcs_ok&0x7f);//0x7f is FPGA limitation // dma_driver_buf_idx_mod = (state.residue&0x7f); fcs_ok = ((fcs_ok&0x80)!=0); - // ht_flag = ((rate_idx&0x10)!=0); + ht_flag = ((rate_idx&0x10)!=0); rate_idx = (rate_idx&0xF); if ( (len>=14 && (!len_overflow)) && (rate_idx>=8 && rate_idx<=15)) { @@ -385,8 +386,8 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id) sc = hdr->seq_ctrl; if ( addr1_low32!=0xffffffff || addr1_high16!=0xffff ) - printk("%s openwifi_rx_interrupt:%4dbytes %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x fcs%d buf_idx%d %ddBm\n", sdr_compatible_str, - len, wifi_rate_table[rate_idx], hdr->frame_control, hdr->duration_id, + printk("%s openwifi_rx_interrupt:%4dbytes ht%d %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x fcs%d buf_idx%d %ddBm\n", sdr_compatible_str, + len, ht_flag, wifi_rate_table[rate_idx], hdr->frame_control, hdr->duration_id, reverse16(addr1_high16), reverse32(addr1_low32), reverse16(addr2_high16), reverse32(addr2_low32), reverse16(addr3_high16), reverse32(addr3_low32), sc, fcs_ok, target_buf_idx_old, signal); } @@ -640,8 +641,6 @@ static void openwifi_tx(struct ieee80211_hw *dev, addr3_low32 = *((u32*)(hdr->addr3+2)); addr3_high16 = *((u16*)(hdr->addr3)); } - if (len_mac_pdu>=28) - sc = hdr->seq_ctrl; duration_id = hdr->duration_id; frame_control=hdr->frame_control; @@ -687,6 +686,20 @@ static void openwifi_tx(struct ieee80211_hw *dev, cts_duration = traffic_pkt_duration + sifs + pkt_need_ack*(sifs+ack_duration); } +// this is 11b stuff +// if (info->flags&IEEE80211_TX_RC_USE_SHORT_PREAMBLE) +// printk("%s openwifi_tx: WARNING IEEE80211_TX_RC_USE_SHORT_PREAMBLE\n", sdr_compatible_str); + + if (len_mac_pdu>=28) { + if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { + if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) + priv->seqno += 0x10; + hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); + hdr->seq_ctrl |= cpu_to_le16(priv->seqno); + } + sc = hdr->seq_ctrl; + } + if ( (!addr_flag) && (priv->drv_tx_reg_val[DRV_TX_REG_IDX_PRINT_CFG]&2) ) printk("%s openwifi_tx: %4dbytes %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x flag%08x retr%d ack%d prio%d q%d wr%d rd%d\n", sdr_compatible_str, len_mac_pdu, wifi_rate_all[rate_hw_value],frame_control,duration_id, @@ -701,16 +714,6 @@ static void openwifi_tx(struct ieee80211_hw *dev, // info->status.rates[2].idx,info->status.rates[2].count,info->status.rates[2].flags, // info->status.rates[3].idx,info->status.rates[3].count,info->status.rates[3].flags); -// this is 11b stuff -// if (info->flags&IEEE80211_TX_RC_USE_SHORT_PREAMBLE) -// printk("%s openwifi_tx: WARNING IEEE80211_TX_RC_USE_SHORT_PREAMBLE\n", sdr_compatible_str); - - if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { - if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) - priv->seqno += 0x10; - hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); - hdr->seq_ctrl |= cpu_to_le16(priv->seqno); - } // -----------end of preprocess some info from header and skb---------------- // /* HW will perform RTS-CTS when only RTS flags is set. @@ -869,6 +872,7 @@ static int openwifi_start(struct ieee80211_hw *dev) memset(priv->drv_tx_reg_val, 0, sizeof(priv->drv_tx_reg_val)); memset(priv->drv_rx_reg_val, 0, sizeof(priv->drv_rx_reg_val)); memset(priv->drv_xpu_reg_val, 0, sizeof(priv->drv_xpu_reg_val)); + priv->drv_xpu_reg_val[DRV_XPU_REG_IDX_GIT_REV] = GIT_REV; //turn on radio if (priv->tx_intf_cfg == TX_INTF_BW_20MHZ_AT_N_10MHZ_ANT1) { diff --git a/driver/sdr.h b/driver/sdr.h index 9adbe70..69915fd 100644 --- a/driver/sdr.h +++ b/driver/sdr.h @@ -76,6 +76,8 @@ union u16_byte2 { #define DRV_RX_REG_IDX_FREQ_BW_CFG 1 #define DRV_RX_REG_IDX_PRINT_CFG (MAX_NUM_DRV_REG-1) +#define DRV_XPU_REG_IDX_GIT_REV (MAX_NUM_DRV_REG-1) + // ------end of software reg definition ------------ #define MAX_NUM_VIF 4 diff --git a/kernel_boot/boards/adrv9361z7035/devicetree.dtb b/kernel_boot/boards/adrv9361z7035/devicetree.dtb index 71a7c19..d8090ff 100644 Binary files a/kernel_boot/boards/adrv9361z7035/devicetree.dtb and b/kernel_boot/boards/adrv9361z7035/devicetree.dtb differ diff --git a/kernel_boot/boards/adrv9361z7035/devicetree.dts b/kernel_boot/boards/adrv9361z7035/devicetree.dts index cfd0e27..074c2e4 100644 --- a/kernel_boot/boards/adrv9361z7035/devicetree.dts +++ b/kernel_boot/boards/adrv9361z7035/devicetree.dts @@ -854,10 +854,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ }; leds { diff --git a/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts b/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts index 4258848..cc92271 100644 --- a/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts +++ b/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts @@ -1002,10 +1002,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@43000000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/adrv9364z7020/devicetree.dtb b/kernel_boot/boards/adrv9364z7020/devicetree.dtb index 2b21f77..4bb5871 100644 Binary files a/kernel_boot/boards/adrv9364z7020/devicetree.dtb and b/kernel_boot/boards/adrv9364z7020/devicetree.dtb differ diff --git a/kernel_boot/boards/adrv9364z7020/devicetree.dts b/kernel_boot/boards/adrv9364z7020/devicetree.dts index 2bbd625..8a28b42 100644 --- a/kernel_boot/boards/adrv9364z7020/devicetree.dts +++ b/kernel_boot/boards/adrv9364z7020/devicetree.dts @@ -843,10 +843,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ }; leds { diff --git a/kernel_boot/boards/zc702_fmcs2/devicetree.dtb b/kernel_boot/boards/zc702_fmcs2/devicetree.dtb index 06f4e02..6d59d72 100644 Binary files a/kernel_boot/boards/zc702_fmcs2/devicetree.dtb and b/kernel_boot/boards/zc702_fmcs2/devicetree.dtb differ diff --git a/kernel_boot/boards/zc702_fmcs2/devicetree.dts b/kernel_boot/boards/zc702_fmcs2/devicetree.dts index 064c02a..0d13b18 100644 --- a/kernel_boot/boards/zc702_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zc702_fmcs2/devicetree.dts @@ -869,10 +869,10 @@ phandle = <0x13>; }; */ - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@7c400000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/zc706_fmcs2/devicetree.dtb b/kernel_boot/boards/zc706_fmcs2/devicetree.dtb index 441d0b3..4504ba3 100644 Binary files a/kernel_boot/boards/zc706_fmcs2/devicetree.dtb and b/kernel_boot/boards/zc706_fmcs2/devicetree.dtb differ diff --git a/kernel_boot/boards/zc706_fmcs2/devicetree.dts b/kernel_boot/boards/zc706_fmcs2/devicetree.dts index 1fee3f7..ee8f990 100644 --- a/kernel_boot/boards/zc706_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zc706_fmcs2/devicetree.dts @@ -865,10 +865,10 @@ phandle = <0x13>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@7c400000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/zcu102_fmcs2/system.dtb b/kernel_boot/boards/zcu102_fmcs2/system.dtb index 71ed848..cca5084 100644 Binary files a/kernel_boot/boards/zcu102_fmcs2/system.dtb and b/kernel_boot/boards/zcu102_fmcs2/system.dtb differ diff --git a/kernel_boot/boards/zcu102_fmcs2/system.dts b/kernel_boot/boards/zcu102_fmcs2/system.dts index 4bf2081..d5406d2 100644 --- a/kernel_boot/boards/zcu102_fmcs2/system.dts +++ b/kernel_boot/boards/zcu102_fmcs2/system.dts @@ -2569,10 +2569,10 @@ dma-names = "tx"; }; - axi-sysid-0@85000000 { + /*axi-sysid-0@85000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x85000000 0x10000>; - }; + };*/ }; clocks { diff --git a/kernel_boot/boards/zed_fmcs2/devicetree.dtb b/kernel_boot/boards/zed_fmcs2/devicetree.dtb index d7023aa..280f234 100644 Binary files a/kernel_boot/boards/zed_fmcs2/devicetree.dtb and b/kernel_boot/boards/zed_fmcs2/devicetree.dtb differ diff --git a/kernel_boot/boards/zed_fmcs2/devicetree.dts b/kernel_boot/boards/zed_fmcs2/devicetree.dts index b99efaa..99f1637 100644 --- a/kernel_boot/boards/zed_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zed_fmcs2/devicetree.dts @@ -754,10 +754,10 @@ phandle = <0x15>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ i2c@41620000 { compatible = "xlnx,axi-iic-1.01.b", "xlnx,xps-iic-2.00.a"; diff --git a/user_space/update_sdcard.sh b/user_space/update_sdcard.sh index d1c75bc..da7cc18 100755 --- a/user_space/update_sdcard.sh +++ b/user_space/update_sdcard.sh @@ -35,8 +35,8 @@ fi # detect SD card mounting status if [ -d "$SDCARD_DIR/BOOT/" ]; then echo "$SDCARD_DIR/BOOT/" - mkdir $SDCARD_DIR/BOOT/openwifi - rm -rf $SDCARD_DIR/BOOT/README.txt + sudo mkdir $SDCARD_DIR/BOOT/openwifi + sudo rm -rf $SDCARD_DIR/BOOT/README.txt else echo "$SDCARD_DIR/BOOT/ does not exist!" exit 1 @@ -95,23 +95,23 @@ do dtc -I dts -O dtb -o $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dts_filename_tmp mkdir $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP - cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP - cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP + sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP + sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP sudo true done -mkdir $SDCARD_DIR/BOOT/openwifi/zynq-common -cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/openwifi/zynq-common/ -mkdir $SDCARD_DIR/BOOT/openwifi/zynqmp-common -cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/openwifi/zynqmp-common/ +sudo mkdir $SDCARD_DIR/BOOT/openwifi/zynq-common +sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/openwifi/zynq-common/ +sudo mkdir $SDCARD_DIR/BOOT/openwifi/zynqmp-common +sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/openwifi/zynqmp-common/ # Copy uImage BOOT.BIN and devicetree to SD card BOOT partition -cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/$dtb_filename $SDCARD_DIR/BOOT/ -cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/ +sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/$dtb_filename $SDCARD_DIR/BOOT/ +sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/ if [ "$BOARD_NAME" == "zcu102_fmcs2" ] || [ "$BOARD_NAME" == "zcu102_9371" ]; then - cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/ + sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/ else - cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/ + suod cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/ fi sudo mkdir $SDCARD_DIR/rootfs/root/openwifi