On 7/24/2013 6:11 PM, Artturi Alm wrote:
Hi,
No //-comments, { on the same line as if/else, and else after }, but
since both have only one statement, no braces needed.
Same goes for the for-loops, I suggest reading style(9).
- Artturi
Whoops, completely forgot. This should be correct:
--- /home/nathan/scratch/rt2860.c Wed Jul 24 15:26:24 2013
+++ /usr/src/sys/dev/ic/rt2860.c Thu Jul 25 01:10:57 2013
@@ -199,6 +199,13 @@
RT3070_DEF_RF
};
+static const struct {
+ uint8_t reg;
+ uint8_t val;
+} rt3572_def_rf[] = {
+ RT3572_DEF_RF
+};
+
int
rt2860_attach(void *xsc, int id)
{
@@ -2367,10 +2374,14 @@
RAL_WRITE(sc, RT3070_GPIO_SWITCH, tmp & ~0x20);
/* initialize RF registers to default value */
- for (i = 0; i < nitems(rt3090_def_rf); i++) {
- rt3090_rf_write(sc, rt3090_def_rf[i].reg,
- rt3090_def_rf[i].val);
- }
+ if (sc->mac_ver == 0x3572)
+ for (i = 0; i < nitems(rt3572_def_rf); i++)
+ rt3090_rf_write(sc, rt3572_def_rf[i].reg,
+ rt3572_def_rf[i].val);
+ else
+ for (i = 0; i < nitems(rt3090_def_rf); i++)
+ rt3090_rf_write(sc, rt3090_def_rf[i].reg,
+ rt3090_def_rf[i].val);
/* select 20MHz bandwidth */
rt3090_rf_write(sc, 31, 0x14);