You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/10/30 07:08:58 UTC

[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno opened a new pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

TE-Masatoshi-Ueno opened a new pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175


   Summary:
   - This commit enables gs2200m driver re-associate to the access point when disassociated
   
   Impact:
   - Affects gs2200m only
   
   Testing:
   - Tested with spresense:wifi
   
   @masayuki2009 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514968592



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       Please confirm commit a4d35d8 .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514967722



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       Please confirm commit 7577186 .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514968592



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       Please confirm commit ed6906e .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514933017



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       OK, I will move to struct gs2200m_dev_s.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514981376



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       Thanks. I merged into 1 commit 928c5ce .

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       Thanks. I merged into 1 commit 928c5ce .

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       Thanks. I merged into 1 commit 928c5ce .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#issuecomment-719410638


   Yes, all connections are reset after disassociated. so, all cid reset by this command, "dev->valid_cid_bits = 0;".


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514970577



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       OK, but please fixup the commit (we don't need the separate commit)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514971737



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       OK, but please fixup the commit (we don't need the separate commit)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514985658



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,33 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == dev->disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {
+              /* release & initialize pkt_dat before retry */
+
+              _release_pkt_dat(dev, pkt_dat);
+              memset(pkt_dat, 0, sizeof(pkt_dat));
+
+              usleep(100 * 1000);
+            }

Review comment:
       please use nxsig_usleep() instead of usleep() inside the kernel space.
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       OK, please add a comment such as "Discard incoming packets untile timeout happens"
   In this case, we don't need to pass pkt_dat, so just call like ```gs2200m_recv_pkt(dev, NULL)```
   Also, we don't need to call ```_releae_pkt_dat(dev, ), memset(pkt_dat, ...)```
   
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,33 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == dev->disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {
+              /* release & initialize pkt_dat before retry */
+
+              _release_pkt_dat(dev, pkt_dat);
+              memset(pkt_dat, 0, sizeof(pkt_dat));
+
+              usleep(100 * 1000);
+            }

Review comment:
       Thanks.
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       OK, I understand.
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,33 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == dev->disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {
+              /* release & initialize pkt_dat before retry */
+
+              _release_pkt_dat(dev, pkt_dat);
+              memset(pkt_dat, 0, sizeof(pkt_dat));
+
+              usleep(100 * 1000);
+            }

Review comment:
       Thanks.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 merged pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514972332



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       OK, but please fixup the commit (we don't need the separate commit)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514936737



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       If some socket programs send packets before disassociated, many "ERROR: INVALID INPUT" response is received in this timing.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514970577



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       OK, but please fixup the commit (we don't need a separate commit)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514943505



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       Yes,  that's right.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#issuecomment-719397608


   @TE-Masatoshi-Ueno 
   How about existing connections and packet queue?
   In my understanding, the connections will be invalid after rejoining to AP.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514972528



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       OK, but please fixup the commit (we don't need the separate commit)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514968120



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       Please confirm commit a4d35d8 .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514967434



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       Please confirm commit 04db01d.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514919817



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},
   {"ERROR", TYPE_ERROR},
   {"DISCONNECT", TYPE_DISCONNECT},
   {"CONNECT", TYPE_CONNECT},
   {"Serial2WiFi APP", TYPE_BOOT_MSG}
 };
 
+static bool gs2200m_disassociate_flag = false;
+static struct gs2200m_assoc_msg reconnect_msg;
+

Review comment:
       Shall we add these variables into struct gs2200m_dev_s?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       Do we need to call gs2200m_disassociate() after we received a disassociation event?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -2573,6 +2584,8 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
 {
   enum pkt_type_e t;
 
+  memcpy(&reconnect_msg, msg, sizeof(struct gs2200m_assoc_msg));
+

Review comment:
       Please add a comment such as "Remember assoc request msg for reconnection"
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       Do we need both messages?
   When can we see each message?
   

##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       Do we have more packets to receive?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514934735



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       I add this command for insurance, but find this function send disassociation AT command only...  Yes, I should remove this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r515762680



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,33 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == dev->disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {
+              /* release & initialize pkt_dat before retry */
+
+              _release_pkt_dat(dev, pkt_dat);
+              memset(pkt_dat, 0, sizeof(pkt_dat));
+
+              usleep(100 * 1000);
+            }

Review comment:
       I update to gs2200m_recv_pkt(dev, NULL) and nxsig_usleep(), and add comment at 76f2069 .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514981581



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do

Review comment:
       Thanks. I merged into 1 commit 928c5ce .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514941889



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -3071,6 +3086,34 @@ static void gs2200m_irq_worker(FAR void *arg)
 
   t = gs2200m_recv_pkt(dev, pkt_dat);
 
+  if (true == gs2200m_disassociate_flag)
+    {
+      /* Disassociate recovery */
+
+      wlwarn("=== receive DISASSOCIATE\n");
+      dev->valid_cid_bits = 0;
+
+      gs2200m_disassociate(dev);
+      do
+        {
+          while (gs2200m_recv_pkt(dev, pkt_dat) != TYPE_TIMEOUT)
+            {

Review comment:
       Hmm, so you mean that we might receive "ERROR: INVALID INPUT"  messages AFTER we received "Disassociation Event".  So here, we need to call gs2200m_recv_pkt() to discard such messages UNTIL timeout happens.
   Is my understanding correct?
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] TE-Masatoshi-Ueno commented on a change in pull request #2175: gs2200m: Check disassociation from AP and enable rejoin

Posted by GitBox <gi...@apache.org>.
TE-Masatoshi-Ueno commented on a change in pull request #2175:
URL: https://github.com/apache/incubator-nuttx/pull/2175#discussion_r514932687



##########
File path: drivers/wireless/gs2200m.c
##########
@@ -247,12 +248,17 @@ static const struct file_operations g_gs2200m_fops =
 static struct evt_code_s _evt_table[] =
 {
   {"OK", TYPE_OK},
+  {"Disassociation Event", TYPE_DISASSOCIATE},
+  {"DISASSOCIATED", TYPE_DISASSOCIATE},

Review comment:
       In most cases we will receive "Disassociation Event" message. We will receive "DISASSOCIATED" message only when we don't associate to AP and send connect AT command, so I should remove "DISASSOCIATED" message from this table.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org