+static int __netconfig_set_rps_cpus(void)
+{
+ int fd, curr;
+ ssize_t count;
+ char t_buf[TEMP_BUFFER_LEN];
+ char r_buf[TEMP_BUFFER_LEN];
+
+ if (access(WIFI_MAC_ADD_PATH, F_OK) != 0) {
+ DBG("WiFi driver is not loaded... ");
+ return -1;
+ } else {
+ DBG("WiFi driver loaded... ");
+ }
+
+ 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 (count < 0) {
+ DBG("read failed");
+ close(fd);
+ return -1;
+ } else {
+ DBG("read size = %zd", 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 = %zd", 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;
+}
+