X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fwifi-firmware.c;h=ba63664b498497de4cd1d0b0e87890dac3fed6d8;hb=cab64fd4b6a7ac73c2531a63321c25cb5921b36c;hp=60a7abe1366d32aa00a4031cc8fd9996d8acec19;hpb=88a062f74b504202f65b636c6d0332629639958f;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git diff --git a/src/wifi-firmware.c b/src/wifi-firmware.c index 60a7abe..ba63664 100755 --- a/src/wifi-firmware.c +++ b/src/wifi-firmware.c @@ -131,7 +131,8 @@ static int __netconfig_p2p_firmware_stop(void) static int __netconfig_softap_firmware_start(void) { - if (!netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_TETHERING)) + if (!netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_TETHERING) + && !netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_WIFI_SOFTAP)) return -ENODEV; int rv = 0; @@ -152,7 +153,8 @@ static int __netconfig_softap_firmware_start(void) static int __netconfig_softap_firmware_stop(void) { - if (!netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_TETHERING)) + if (!netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_TETHERING) + && !netconfig_check_feature_supported(NETCONFIG_SUPPORTED_FEATURE_WIFI_SOFTAP)) return -ENODEV; int rv = 0; @@ -212,7 +214,7 @@ static int __netconfig_wifi_firmware_stop(enum netconfig_wifi_firmware type) static int __netconfig_set_rps_cpus(void) { - int fd, i; + int fd, curr; ssize_t count; char t_buf[TEMP_BUFFER_LEN]; char r_buf[TEMP_BUFFER_LEN]; @@ -224,50 +226,51 @@ static int __netconfig_set_rps_cpus(void) DBG("WiFi driver loaded... "); } - for (i = 0; i < QUAD_CPUS_COUNT; i++) { - snprintf(t_buf, TEMP_BUFFER_LEN, "/sys/class/net/wlan0/queues/rx-%d/rps_cpus", i); - DBG("Command : [%s]", t_buf); - fd = open(t_buf, O_RDWR | O_CLOEXEC); + snprintf(t_buf, TEMP_BUFFER_LEN, "/sys/class/net/wlan0/queues/rx-0/rps_cpus"); + DBG("Command : [%s]", t_buf); + curr = 0; + + while ((fd = open(t_buf, O_RDWR | O_CLOEXEC)) >= 0) { + curr++; + count = read(fd, r_buf, 1); - if (fd < 0) { - DBG("failed to open rps file"); + if (count < 0) { + DBG("read failed"); + close(fd); return -1; } else { - count = read(fd, r_buf, 1); - - if (count < 0) { - DBG("read failed"); - close(fd); - return -1; - } else { - DBG("read size = %d", count); - } - - if (r_buf[0] == 'e') { - close(fd); - continue; - } else { - DBG("e is already written"); - } - - if (lseek(fd, 0, SEEK_SET) < 0) { - DBG("lseek failed"); - close(fd); - return -1; - } - - count = write(fd, "e", 1); - - if (count < 0) { - DBG("write failed"); - close(fd); - return -1; - } else { - DBG("write size = %d", count); - } + DBG("read size = %d", count); + } + if (r_buf[0] == 'e') { close(fd); + DBG("e is already written"); + snprintf(t_buf, TEMP_BUFFER_LEN, "/sys/class/net/wlan0/queues/rx-%d/rps_cpus", curr); + DBG("Command : [%s]", t_buf); + continue; + } else { + DBG("writing e"); + } + + if (lseek(fd, 0, SEEK_SET) < 0) { + DBG("lseek failed"); + close(fd); + return -1; } + + count = write(fd, "e", 1); + + if (count < 0) { + DBG("write failed"); + close(fd); + return -1; + } else { + DBG("write size = %d", count); + } + + close(fd); + snprintf(t_buf, TEMP_BUFFER_LEN, "/sys/class/net/wlan0/queues/rx-%d/rps_cpus", curr); + DBG("Command : [%s]", t_buf); } return 0;