From: taesub kim Date: Fri, 6 Jul 2018 04:01:58 +0000 (+0000) Subject: Merge "Set passphrase for connman service when connecting using WPS without SSID... X-Git-Tag: accepted/tizen/unified/20180709.064832^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0daebbba4d9f73673fedad543d53628ff985273;hp=241d1aa350d7ffcba0d6f79ce28686f85214d64e;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Merge "Set passphrase for connman service when connecting using WPS without SSID" into tizen --- diff --git a/src/wifi-firmware.c b/src/wifi-firmware.c index 60a7abe..812755f 100755 --- a/src/wifi-firmware.c +++ b/src/wifi-firmware.c @@ -212,7 +212,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 +224,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;