Commit 85d47cff authored by Marek Belisko's avatar Marek Belisko Committed by Greg Kroah-Hartman

staging: ft1000: Coding style fix in ft1000ReadProc.

Signed-off-by: default avatarMarek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92914cc8
...@@ -43,126 +43,122 @@ u16 ft1000_read_dpram16 (struct ft1000_device *ft1000dev, u16 indx, ...@@ -43,126 +43,122 @@ u16 ft1000_read_dpram16 (struct ft1000_device *ft1000dev, u16 indx,
static int static int
ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof, ft1000ReadProc(char *page, char **start, off_t off, int count, int *eof,
void *data) void *data)
{ {
struct net_device *dev; struct net_device *dev;
int len; int len;
int i; int i;
unsigned short ledStat; unsigned short ledStat;
unsigned short conStat; unsigned short conStat;
struct ft1000_info *info; struct ft1000_info *info;
char *status[] = { "Idle (Disconnect)", "Searching", "Active (Connected)", char *status[] = {
"Waiting for L2", "Sleep", "No Coverage", "", "" "Idle (Disconnect)",
}; "Searching",
"Active (Connected)",
char *signal[] = { "", "*", "**", "***", "****" }; "Waiting for L2",
int strength; "Sleep",
int quality; "No Coverage",
struct timeval tv; "",
time_t delta; "",
};
dev = (struct net_device *) data;
char *signal[] = { "", "*", "**", "***", "****" };
int strength;
int quality;
struct timeval tv;
time_t delta;
dev = (struct net_device *) data;
info = netdev_priv(dev); info = netdev_priv(dev);
if (off > 0) if (off > 0) {
{ *eof = 1;
*eof = 1; return 0;
return 0; }
}
if (info->ProgConStat != 0xFF) if (info->ProgConStat != 0xFF) {
{ ft1000_read_dpram16(info->pFt1000Dev, FT1000_MAG_DSP_LED,
ft1000_read_dpram16 (info->pFt1000Dev, FT1000_MAG_DSP_LED,
(u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX); (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
info->LedStat = ntohs (ledStat); info->LedStat = ntohs(ledStat);
ft1000_read_dpram16 (info->pFt1000Dev, FT1000_MAG_DSP_CON_STATE, ft1000_read_dpram16(info->pFt1000Dev, FT1000_MAG_DSP_CON_STATE,
(u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX); (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
info->ConStat = ntohs (conStat); info->ConStat = ntohs(conStat);
do_gettimeofday (&tv); do_gettimeofday(&tv);
delta = (tv.tv_sec - info->ConTm); delta = (tv.tv_sec - info->ConTm);
} } else {
else info->ConStat = 0xf;
{ delta = 0;
info->ConStat = 0xf; }
delta = 0;
} i = (info->LedStat) & 0xf;
switch (i) {
case 0x1:
strength = 1;
i = (info->LedStat) & 0xf; break;
switch (i) case 0x3:
{ strength = 2;
case 0x1: break;
strength = 1; case 0x7:
break; strength = 3;
case 0x3: break;
strength = 2; case 0xf:
break; strength = 4;
case 0x7: break;
strength = 3; default:
break; strength = 0;
case 0xf: }
strength = 4;
break; i = (info->LedStat >> 8) & 0xf;
default: switch (i) {
strength = 0; case 0x1:
} quality = 1;
break;
i = (info->LedStat >> 8) & 0xf; case 0x3:
switch (i) quality = 2;
{ break;
case 0x1: case 0x7:
quality = 1; quality = 3;
break; break;
case 0x3: case 0xf:
quality = 2; quality = 4;
break; break;
case 0x7: default:
quality = 3; quality = 0;
break; }
case 0xf:
quality = 4; len = 0;
break; PUTM_TO_PAGE(len, page, "Connection Time: %02ld:%02ld:%02ld\n",
default: ((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
quality = 0; PUTM_TO_PAGE(len, page, "Connection Time[s]: %ld\n", delta);
} PUTM_TO_PAGE(len, page, "Asic ID: %s\n",
(info->AsicID) ==
ELECTRABUZZ_ID ? "ELECTRABUZZ ASIC" : "MAGNEMITE ASIC");
len = 0; PUTX_TO_PAGE(len, page, "SKU: ", SKUSZ, info->Sku);
PUTM_TO_PAGE (len, page, "Connection Time: %02ld:%02ld:%02ld\n", PUTX_TO_PAGE(len, page, "EUI64: ", EUISZ, info->eui64);
((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60)); PUTD_TO_PAGE(len, page, "DSP version number: ", DSPVERSZ, info->DspVer);
PUTM_TO_PAGE (len, page, "Connection Time[s]: %ld\n", delta); PUTX_TO_PAGE(len, page, "Hardware Serial Number: ", HWSERNUMSZ,
PUTM_TO_PAGE (len, page, "Asic ID: %s\n", info->HwSerNum);
(info->AsicID) == PUTX_TO_PAGE(len, page, "Caliberation Version: ", CALVERSZ,
ELECTRABUZZ_ID ? "ELECTRABUZZ ASIC" : "MAGNEMITE ASIC"); info->RfCalVer);
PUTX_TO_PAGE (len, page, "SKU: ", SKUSZ, info->Sku); PUTD_TO_PAGE(len, page, "Caliberation Date: ", CALDATESZ,
PUTX_TO_PAGE (len, page, "EUI64: ", EUISZ, info->eui64); info->RfCalDate);
PUTD_TO_PAGE (len, page, "DSP version number: ", DSPVERSZ, info->DspVer); PUTM_TO_PAGE(len, page, "Media State: %s\n",
PUTX_TO_PAGE (len, page, "Hardware Serial Number: ", HWSERNUMSZ, (info->mediastate) ? "link" : "no link");
info->HwSerNum); PUTM_TO_PAGE(len, page, "Connection Status: %s\n",
PUTX_TO_PAGE (len, page, "Caliberation Version: ", CALVERSZ, status[((info->ConStat) & 0x7)]);
info->RfCalVer); PUTM_TO_PAGE(len, page, "RX packets: %ld\n", info->stats.rx_packets);
PUTD_TO_PAGE (len, page, "Caliberation Date: ", CALDATESZ, info->RfCalDate); PUTM_TO_PAGE(len, page, "TX packets: %ld\n", info->stats.tx_packets);
PUTM_TO_PAGE (len, page, "Media State: %s\n", PUTM_TO_PAGE(len, page, "RX bytes: %ld\n", info->stats.rx_bytes);
(info->mediastate) ? "link" : "no link"); PUTM_TO_PAGE(len, page, "TX bytes: %ld\n", info->stats.tx_bytes);
PUTM_TO_PAGE (len, page, "Connection Status: %s\n", PUTM_TO_PAGE(len, page, "Signal Strength: %s\n", signal[strength]);
status[((info->ConStat) & 0x7)]); PUTM_TO_PAGE(len, page, "Signal Quality: %s\n", signal[quality]);
PUTM_TO_PAGE (len, page, "RX packets: %ld\n", info->stats.rx_packets);
PUTM_TO_PAGE (len, page, "TX packets: %ld\n", info->stats.tx_packets); return len;
PUTM_TO_PAGE (len, page, "RX bytes: %ld\n", info->stats.rx_bytes);
PUTM_TO_PAGE (len, page, "TX bytes: %ld\n", info->stats.tx_bytes);
PUTM_TO_PAGE (len, page, "Signal Strength: %s\n", signal[strength]);
PUTM_TO_PAGE (len, page, "Signal Quality: %s\n", signal[quality]);
return len;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment