BigW Consortium Gitlab

Commit 860e7a8c by David Clark

Added MT7697 drivers to sdef

Updated uart driver to return error if file closed vs. WARN_ON Updated mtwifi init script to kill wpa_supplicant for mt7697
parent dad4c3ed
......@@ -217,11 +217,14 @@ size_t mt7697_uart_read(void *arg, u32 *buf, size_t len)
unsigned long end = count;
int err;
WARN_ON(!uart_info->fd_hndl);
oldfs = get_fs();
set_fs(get_ds());
if (!uart_info->fd_hndl) {
dev_err(uart_info->dev, "%s(): device closed\n", __func__);
goto cleanup;
}
dev_dbg(uart_info->dev, "%s(): len(%u)\n", __func__, len * sizeof(u32));
while (offset < end) {
err = kernel_read(uart_info->fd_hndl, offset, ptr, count);
......@@ -262,11 +265,14 @@ size_t mt7697_uart_write(void *arg, const u32 *buf, size_t len)
struct mt7697_uart_info *uart_info = arg;
u8* ptr = (u8*)buf;
WARN_ON(!uart_info->fd_hndl);
oldfs = get_fs();
set_fs(get_ds());
if (!uart_info->fd_hndl) {
dev_err(uart_info->dev, "%s(): device closed\n", __func__);
goto cleanup;
}
dev_dbg(uart_info->dev, "%s(): len(%u)\n", __func__, len);
while (pos < end) {
num_write = kernel_write(uart_info->fd_hndl, ptr, left, pos);
......
......@@ -4,8 +4,6 @@
# MediaTek wireless 7697 specific applications start or stop here
# MediaTek WIFI IoT board is managed by SPI bus.
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/flash/wifi
mt_wifi_start() {
if [ `echo $1 | tr -s '[:upper:]' '[:lower:]` = `echo "uart" | tr -s '[:upper:]' '[:lower:]` ] ; then
echo "Setup MT7697 UART";
......@@ -45,10 +43,13 @@ mt_wifi_start() {
echo "Started MT7697 WiFi $1 core wlan$2";
}
mt_wifi_stop() {
echo "Stop MT7697 WiFi core wlan$1";
kill `ps -eo pid,args --cols=10000 | awk '/^\/sbin\/wpa_supplicant|-i\swlan$1/ && $1 != PROCINFO["pid"] { print $1 }'`
mt_wifi_supplicant_stop() {
echo "Stop MT7697 wpa_supplicant";
kill `ps -eo pid,args --cols=10000 | awk '/^\/sbin\/wpa_supplicant|-D\s*wext/ && $1 != PROCINFO["pid"] { print $1 }'`
sleep 2
}
mt_wifi_stop() {
ifconfig | grep wlan$1 >/dev/null
if [ $? -eq 0 ]; then
ifconfig wlan$1 down
......@@ -65,10 +66,12 @@ case "$1" in
start)
mt_wifi_start $2 $3
;;
stop)
stop)
mt_wifi_supplicant_stop
mt_wifi_stop $2
;;
restart)
restart)
mt_wifi_supplicant_stop
mt_wifi_stop $2
mt_wifi_start $2 $3
;;
......
......@@ -73,10 +73,10 @@ kernelModules:
$MANGOH_ROOT/linux_kernel_modules/iot_slot/0-iot_slot
// Don't enable mt7697 drivers until the appropriate cfg80211 and mac80211 modules are avaialble
// $MANGOH_ROOT/linux_kernel_modules/mt7697q/1-mt7697q
// $MANGOH_ROOT/linux_kernel_modules/mt7697serial/1-mt7697serial
// $MANGOH_ROOT/linux_kernel_modules/mt7697wifi/2-mt7697wifi_core
// mt7697 drivers
$MANGOH_ROOT/linux_kernel_modules/mt7697q/1-mt7697q
$MANGOH_ROOT/linux_kernel_modules/mt7697serial/1-mt7697serial
$MANGOH_ROOT/linux_kernel_modules/mt7697wifi/2-mt7697wifi_core
// spisvc creates a spidev device which will appear as /dev/spidev0.0 once the spidev module is
// loaded.
......
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