All of lore.kernel.org
 help / color / mirror / Atom feed
* rtl8821ae dbi read question
@ 2017-11-04 23:27 Nik Nyby
  2017-11-05 16:50 ` Larry Finger
  0 siblings, 1 reply; 10+ messages in thread
From: Nik Nyby @ 2017-11-04 23:27 UTC (permalink / raw)
  To: linux-wireless, pkshih, Larry.Finger

In drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c, we have this 
function:

  static u8 _rtl8821ae_dbi_read(struct rtl_priv *rtlpriv, u16 addr)
  {
      u16 read_addr = addr & 0xfffc;
      u8 tmp = 0, count = 0, ret = 0;

      rtl_write_word(rtlpriv, REG_DBI_ADDR, read_addr);
      rtl_write_byte(rtlpriv, REG_DBI_FLAG, 0x2);
      tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG);
      count = 0;
      while (tmp && count < 20) {
          udelay(10);
          tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG);
          count++;
      }
      if (0 == tmp) {
          read_addr = REG_DBI_RDATA + addr % 4;
          ret = rtl_read_word(rtlpriv, read_addr);
      }
      return ret;
  }

Near the end of the function, in this line:

   ret = rtl_read_word(rtlpriv, read_addr);

rtl_read_word() returns a u16, but "ret" is declared as a u8. Is that a 
problem, or is this code correct?

What's prompting this question is that I'm getting frequent disconnects 
from my access point with my rtl8821ae device. I've experienced this 
behavior both before and after the recent change to this function in 
commit b8b8b16352cd90c6083033fd4487f04fae935c18.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-19  0:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-04 23:27 rtl8821ae dbi read question Nik Nyby
2017-11-05 16:50 ` Larry Finger
2017-11-05 20:53   ` Nik Nyby
2017-11-06  1:46     ` Larry Finger
2017-11-05 21:15   ` Nik Nyby
2017-11-05 21:29     ` James Cameron
2017-11-06  2:09     ` Larry Finger
2017-11-06  4:09       ` Nik Nyby
2017-11-06 13:52         ` Larry Finger
2017-11-19  0:39           ` Nik Nyby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.