Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small fixes #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#make -C /home/ralink/7630/wireless-testing/ M=$PWD
make -C /lib/modules/3.5.0-24-generic/build/ M=$PWD
#!/bin/bash -e
kernel=`uname -r`
make -C /lib/modules/"$kernel"/build/ M=$PWD
11 changes: 6 additions & 5 deletions load.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
insmod /lib/modules/3.5.0-24-generic/kernel/drivers/misc/eeprom/eeprom.ko
insmod /lib/modules/3.5.0-24-generic/kernel/drivers/misc/eeprom/eeprom_93cx6.ko
insmod /lib/modules/3.5.0-24-generic/kernel/lib/crc-ccitt.ko
insmod /lib/modules/3.5.0-24-generic/kernel/net/wireless/cfg80211.ko
insmod /lib/modules/3.5.0-24-generic/kernel/net/mac80211/mac80211.ko
#!/bin/bash -e
modprobe eeprom.ko
modprobe eeprom_93cx6.ko
modprobe crc-ccitt.ko
modprobe cfg80211.ko
modprobe mac80211.ko
insmod ./rt2x00lib.ko;
insmod ./rt2x00pci.ko;
insmod ./rt2800lib.ko;
Expand Down
42 changes: 21 additions & 21 deletions rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ static inline void rt2x00dev_pci_register_write(struct rt2x00_dev *rt2x00dev,
u32 value)
{
#if 1
if (((offset) >= 0x2000 & (offset) < 0x2a00)|| (offset) == 0x0500)
;
else
if (((offset) >= 0x2000 && (offset) < 0x2a00)|| (offset) == 0x0500)
;
else
printk("rt2x00dev_pci_register_write 0x%x = 0x%x\n",(offset),(value));
#endif
#endif
writel(value, rt2x00dev->csr.base + offset);
}

Expand Down Expand Up @@ -98,10 +98,10 @@ EXPORT_SYMBOL_GPL(rt2x00lib_get_bssidx);
int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
{
int status;
unsigned int i=0;
u32 reg;
printk("===>%s\n",__FUNCTION__);
unsigned int i=0;
u32 reg;


/*
* Don't enable the radio twice.
* And check if the hardware button has been disabled.
Expand Down Expand Up @@ -1136,7 +1136,7 @@ rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
status = rt2x00queue_alloc_rxskbs(rt2x00dev->rx);
if (status)
return status;

set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags);

return 0;
Expand Down Expand Up @@ -1194,7 +1194,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
return -EINVAL;
else
printk("ASIC is ready\n");

if (rt2800_dev_wait_csr_ready(rt2x00dev))
return -EBUSY;
rt2x00dev_pci_register_write(rt2x00dev, PWR_PIN_CFG, 0x00000000);
Expand Down Expand Up @@ -1402,7 +1402,7 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
tasklet_kill(&rt2x00dev->tx1damdone_tasklet);
tasklet_kill(&rt2x00dev->tx2damdone_tasklet);
tasklet_kill(&rt2x00dev->tx3damdone_tasklet);


/*
* Uninitialize device.
Expand Down Expand Up @@ -1531,11 +1531,11 @@ void MT76x0_WLAN_ChipOnOff(
{
/*
Restore all HW default value and reset RF.
*/
*/
WlanFunCtrl.field.WLAN_RESET_MT7630 = 1;
WlanFunCtrl.field.WLAN_RESET_RF_MT7630 = 1;
printk("Reset(1) WlanFunCtrl.word = 0x%x\n", WlanFunCtrl.word);
rt2x00dev_pci_register_write(rt2x00dev, WLAN_FUN_CTRL, WlanFunCtrl.word);
rt2x00dev_pci_register_write(rt2x00dev, WLAN_FUN_CTRL, WlanFunCtrl.word);
udelay(50);
WlanFunCtrl.field.WLAN_RESET_MT7630 = 0;
WlanFunCtrl.field.WLAN_RESET_RF_MT7630 = 0;
Expand All @@ -1550,7 +1550,7 @@ void MT76x0_WLAN_ChipOnOff(
/*
Enable WLAN function and clock
WLAN_FUN_CTRL[1:0] = 0x3
*/
*/
WlanFunCtrl.field.WLAN_CLK_EN_MT7630 = 1;
WlanFunCtrl.field.WLAN_EN_MT7630 = 1;
}
Expand All @@ -1566,7 +1566,7 @@ void MT76x0_WLAN_ChipOnOff(
}

printk("WlanFunCtrl.word = 0x%x\n", WlanFunCtrl.word);
rt2x00dev_pci_register_write(rt2x00dev, WLAN_FUN_CTRL, WlanFunCtrl.word);
rt2x00dev_pci_register_write(rt2x00dev, WLAN_FUN_CTRL, WlanFunCtrl.word);
udelay(50);

if (bOn)
Expand All @@ -1577,14 +1577,14 @@ void MT76x0_WLAN_ChipOnOff(

if (bOn == 1)
{
unsigned int index = 0;
unsigned int index = 0;
CMB_CTRL_STRUC CmbCtrl;

CmbCtrl.word = 0;

do
{
do
do
{
rt2x00dev_pci_register_read(rt2x00dev, CMB_CTRL, &CmbCtrl.word);

Expand Down Expand Up @@ -1621,7 +1621,7 @@ void MT76x0_WLAN_ChipOnOff(
{
break;
}
}
}
while (1);


Expand All @@ -1630,7 +1630,7 @@ void MT76x0_WLAN_ChipOnOff(
CmbCtrl.field.AUX_OPT_Bit14_TRSW1_as_GPIO=1;
CmbCtrl.field.AUX_OPT_Bit11_Rsv=1;
rt2x00dev_pci_register_write(rt2x00dev, CMB_CTRL, CmbCtrl.word);

}

g_WlanFunCtrl.word = WlanFunCtrl.word;
Expand Down Expand Up @@ -1658,7 +1658,7 @@ int WaitForAsicReady(struct rt2x00_dev *rt2x00dev)

printk("%s(0x%x):AsicNotReady!\n",
__FUNCTION__, mac_val);

return 0;
}

Expand Down
7 changes: 2 additions & 5 deletions run.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash

while :
do

while : do
iwlist wlan11 sc
sleep 15

sleep 15
done
1 change: 1 addition & 0 deletions unload.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash -e
rmmod rt2800pci.ko;
rmmod rt2800lib.ko;
rmmod rt2x00pci.ko;
Expand Down