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,7 +43,7 @@ u16 ft1000_read_dpram16 (struct ft1000_device *ft1000dev, u16 indx,
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)
{
struct net_device *dev;
......@@ -54,8 +54,15 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
struct ft1000_info *info;
char *status[] = { "Idle (Disconnect)", "Searching", "Active (Connected)",
"Waiting for L2", "Sleep", "No Coverage", "", ""
char *status[] = {
"Idle (Disconnect)",
"Searching",
"Active (Connected)",
"Waiting for L2",
"Sleep",
"No Coverage",
"",
"",
};
char *signal[] = { "", "*", "**", "***", "****" };
......@@ -67,36 +74,29 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
dev = (struct net_device *) data;
info = netdev_priv(dev);
if (off > 0)
{
if (off > 0) {
*eof = 1;
return 0;
}
if (info->ProgConStat != 0xFF)
{
ft1000_read_dpram16 (info->pFt1000Dev, FT1000_MAG_DSP_LED,
if (info->ProgConStat != 0xFF) {
ft1000_read_dpram16(info->pFt1000Dev, FT1000_MAG_DSP_LED,
(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);
info->ConStat = ntohs (conStat);
do_gettimeofday (&tv);
info->ConStat = ntohs(conStat);
do_gettimeofday(&tv);
delta = (tv.tv_sec - info->ConTm);
}
else
{
} else {
info->ConStat = 0xf;
delta = 0;
}
i = (info->LedStat) & 0xf;
switch (i)
{
switch (i) {
case 0x1:
strength = 1;
break;
......@@ -114,8 +114,7 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
}
i = (info->LedStat >> 8) & 0xf;
switch (i)
{
switch (i) {
case 0x1:
quality = 1;
break;
......@@ -132,35 +131,32 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
quality = 0;
}
len = 0;
PUTM_TO_PAGE (len, page, "Connection Time: %02ld:%02ld:%02ld\n",
PUTM_TO_PAGE(len, page, "Connection Time: %02ld:%02ld:%02ld\n",
((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
PUTM_TO_PAGE (len, page, "Connection Time[s]: %ld\n", delta);
PUTM_TO_PAGE (len, page, "Asic ID: %s\n",
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");
PUTX_TO_PAGE (len, page, "SKU: ", SKUSZ, info->Sku);
PUTX_TO_PAGE (len, page, "EUI64: ", EUISZ, info->eui64);
PUTD_TO_PAGE (len, page, "DSP version number: ", DSPVERSZ, info->DspVer);
PUTX_TO_PAGE (len, page, "Hardware Serial Number: ", HWSERNUMSZ,
PUTX_TO_PAGE(len, page, "SKU: ", SKUSZ, info->Sku);
PUTX_TO_PAGE(len, page, "EUI64: ", EUISZ, info->eui64);
PUTD_TO_PAGE(len, page, "DSP version number: ", DSPVERSZ, info->DspVer);
PUTX_TO_PAGE(len, page, "Hardware Serial Number: ", HWSERNUMSZ,
info->HwSerNum);
PUTX_TO_PAGE (len, page, "Caliberation Version: ", CALVERSZ,
PUTX_TO_PAGE(len, page, "Caliberation Version: ", CALVERSZ,
info->RfCalVer);
PUTD_TO_PAGE (len, page, "Caliberation Date: ", CALDATESZ, info->RfCalDate);
PUTM_TO_PAGE (len, page, "Media State: %s\n",
PUTD_TO_PAGE(len, page, "Caliberation Date: ", CALDATESZ,
info->RfCalDate);
PUTM_TO_PAGE(len, page, "Media State: %s\n",
(info->mediastate) ? "link" : "no link");
PUTM_TO_PAGE (len, page, "Connection Status: %s\n",
PUTM_TO_PAGE(len, page, "Connection Status: %s\n",
status[((info->ConStat) & 0x7)]);
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);
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]);
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);
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;
}
......
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