aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/sbe-2t3e3
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/sbe-2t3e3')
-rw-r--r--drivers/staging/sbe-2t3e3/2t3e3.h21
-rw-r--r--drivers/staging/sbe-2t3e3/ctrl.c17
-rw-r--r--drivers/staging/sbe-2t3e3/ctrl.h16
-rw-r--r--drivers/staging/sbe-2t3e3/dc.c7
-rw-r--r--drivers/staging/sbe-2t3e3/intr.c4
-rw-r--r--drivers/staging/sbe-2t3e3/maps.c9
-rw-r--r--drivers/staging/sbe-2t3e3/module.c2
-rw-r--r--drivers/staging/sbe-2t3e3/netdev.c6
8 files changed, 39 insertions, 43 deletions
diff --git a/drivers/staging/sbe-2t3e3/2t3e3.h b/drivers/staging/sbe-2t3e3/2t3e3.h
index ccad049c1122..e7bf721f3fd1 100644
--- a/drivers/staging/sbe-2t3e3/2t3e3.h
+++ b/drivers/staging/sbe-2t3e3/2t3e3.h
@@ -613,12 +613,12 @@
* descriptor list and data buffer
*
**********************************************************************/
-typedef struct {
+struct t3e3_rx_desc {
u32 rdes0;
u32 rdes1;
u32 rdes2;
u32 rdes3;
-} t3e3_rx_desc_t;
+};
#define SBE_2T3E3_RX_DESC_RING_SIZE 64
@@ -648,12 +648,12 @@ typedef struct {
/*********************/
-typedef struct {
+struct t3e3_tx_desc {
u32 tdes0;
u32 tdes1;
u32 tdes2;
u32 tdes3;
-} t3e3_tx_desc_t;
+};
#define SBE_2T3E3_TX_DESC_RING_SIZE 256
@@ -701,7 +701,7 @@ struct channel {
} h;
/* statistics */
- t3e3_stats_t s;
+ struct t3e3_stats s;
/* running */
struct {
@@ -709,7 +709,7 @@ struct channel {
} r;
/* parameters */
- t3e3_param_t p;
+ struct t3e3_param p;
u32 liu_regs[SBE_2T3E3_LIU_REG_MAX]; /* LIU registers */
u32 framer_regs[SBE_2T3E3_FRAMER_REG_MAX]; /* Framer registers */
@@ -723,12 +723,12 @@ struct channel {
u32 interrupt_enable_mask;
/* receive chain/ring */
- t3e3_rx_desc_t *rx_ring;
+ struct t3e3_rx_desc *rx_ring;
struct sk_buff *rx_data[SBE_2T3E3_RX_DESC_RING_SIZE];
u32 rx_ring_current_read;
/* transmit chain/ring */
- t3e3_tx_desc_t *tx_ring;
+ struct t3e3_tx_desc *tx_ring;
struct sk_buff *tx_data[SBE_2T3E3_TX_DESC_RING_SIZE];
u32 tx_ring_current_read;
u32 tx_ring_current_write;
@@ -760,8 +760,7 @@ void t3e3_init(struct channel *);
void t3e3_if_up(struct channel *);
void t3e3_if_down(struct channel *);
int t3e3_if_start_xmit(struct sk_buff *skb, struct net_device *dev);
-void t3e3_if_config(struct channel *, u32, char *,
- t3e3_resp_t *, int *);
+void t3e3_if_config(struct channel *, u32, char *, struct t3e3_resp *, int *);
void t3e3_set_frame_type(struct channel *, u32);
u32 t3e3_eeprom_read_word(struct channel *, u32);
void t3e3_read_card_serial_number(struct channel *);
@@ -838,7 +837,7 @@ static inline int has_two_ports(struct pci_dev *pdev)
return pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P0;
}
-#define dev_to_priv(dev) (*(struct channel **) ((hdlc_device*)(dev) + 1))
+#define dev_to_priv(dev) (*(struct channel **) ((hdlc_device *)(dev) + 1))
static inline u32 dc_read(unsigned long addr, u32 reg)
{
diff --git a/drivers/staging/sbe-2t3e3/ctrl.c b/drivers/staging/sbe-2t3e3/ctrl.c
index d280bcfd660a..e0964ac9e7d7 100644
--- a/drivers/staging/sbe-2t3e3/ctrl.c
+++ b/drivers/staging/sbe-2t3e3/ctrl.c
@@ -164,12 +164,12 @@ static void t3e3_reg_write(struct channel *sc, u32 *reg)
}
}
-static void t3e3_port_get(struct channel *sc, t3e3_param_t *param)
+static void t3e3_port_get(struct channel *sc, struct t3e3_param *param)
{
- memcpy(param, &(sc->p), sizeof(t3e3_param_t));
+ memcpy(param, &(sc->p), sizeof(struct t3e3_param));
}
-static void t3e3_port_set(struct channel *sc, t3e3_param_t *param)
+static void t3e3_port_set(struct channel *sc, struct t3e3_param *param)
{
if (param->frame_mode != 0xff)
cpld_set_frame_mode(sc, param->frame_mode);
@@ -216,8 +216,7 @@ static void t3e3_port_set(struct channel *sc, t3e3_param_t *param)
cpld_set_scrambler(sc, param->scrambler);
}
-static void t3e3_port_get_stats(struct channel *sc,
- t3e3_stats_t *stats)
+static void t3e3_port_get_stats(struct channel *sc, struct t3e3_stats *stats)
{
u32 result;
@@ -279,18 +278,18 @@ static void t3e3_port_get_stats(struct channel *sc,
result += exar7250_read(sc, SBE_2T3E3_FRAMER_REG_PMON_HOLDING_REGISTER);
sc->s.CP_BIT += result;
- memcpy(stats, &(sc->s), sizeof(t3e3_stats_t));
+ memcpy(stats, &(sc->s), sizeof(struct t3e3_stats));
}
static void t3e3_port_del_stats(struct channel *sc)
{
- memset(&(sc->s), 0, sizeof(t3e3_stats_t));
+ memset(&(sc->s), 0, sizeof(struct t3e3_stats));
}
void t3e3_if_config(struct channel *sc, u32 cmd, char *set,
- t3e3_resp_t *ret, int *rlen)
+ struct t3e3_resp *ret, int *rlen)
{
- t3e3_param_t *param = (t3e3_param_t *)set;
+ struct t3e3_param *param = (struct t3e3_param *)set;
u32 *data = (u32 *)set;
/* turn off all interrupt */
diff --git a/drivers/staging/sbe-2t3e3/ctrl.h b/drivers/staging/sbe-2t3e3/ctrl.h
index c11a58871845..41f144d75c36 100644
--- a/drivers/staging/sbe-2t3e3/ctrl.h
+++ b/drivers/staging/sbe-2t3e3/ctrl.h
@@ -84,7 +84,7 @@
#define NG_SBE_2T3E3_NODE_TYPE "sbe2T3E3"
#define NG_SBE_2T3E3_COOKIE 0x03800891
-typedef struct t3e3_param {
+struct t3e3_param {
u_int8_t frame_mode; /* FRAME_MODE_* */
u_int8_t crc; /* CRC_* */
u_int8_t receiver_on; /* ON/OFF */
@@ -102,9 +102,9 @@ typedef struct t3e3_param {
u_int8_t fractional_mode; /* FRACTIONAL_MODE_* */
u_int8_t bandwidth_start; /* 0-255 */
u_int8_t bandwidth_stop; /* 0-255 */
-} t3e3_param_t;
+};
-typedef struct t3e3_stats {
+struct t3e3_stats {
u_int64_t in_bytes;
u32 in_packets, in_dropped;
u32 in_errors, in_error_desc, in_error_coll, in_error_drib,
@@ -117,15 +117,15 @@ typedef struct t3e3_stats {
u_int8_t LOC, LOF, OOF, LOS, AIS, FERF, IDLE, AIC, FEAC;
u_int16_t FEBE_code;
u32 LCV, FRAMING_BIT, PARITY_ERROR, FEBE_count, CP_BIT;
-} t3e3_stats_t;
+};
-typedef struct t3e3_resp {
+struct t3e3_resp {
union {
- t3e3_param_t param;
- t3e3_stats_t stats;
+ struct t3e3_param param;
+ struct t3e3_stats stats;
u32 data;
} u;
-} t3e3_resp_t;
+};
#endif /* CTRL_H */
diff --git a/drivers/staging/sbe-2t3e3/dc.c b/drivers/staging/sbe-2t3e3/dc.c
index f207b9e015ce..02510f67ac45 100644
--- a/drivers/staging/sbe-2t3e3/dc.c
+++ b/drivers/staging/sbe-2t3e3/dc.c
@@ -316,13 +316,13 @@ static int dc_init_descriptor_list(struct channel *sc)
if (sc->ether.rx_ring == NULL)
sc->ether.rx_ring = kcalloc(SBE_2T3E3_RX_DESC_RING_SIZE,
- sizeof(t3e3_rx_desc_t), GFP_KERNEL);
+ sizeof(struct t3e3_rx_desc), GFP_KERNEL);
if (sc->ether.rx_ring == NULL)
return -ENOMEM;
if (sc->ether.tx_ring == NULL)
sc->ether.tx_ring = kcalloc(SBE_2T3E3_TX_DESC_RING_SIZE,
- sizeof(t3e3_tx_desc_t), GFP_KERNEL);
+ sizeof(struct t3e3_tx_desc), GFP_KERNEL);
if (sc->ether.tx_ring == NULL) {
kfree(sc->ether.rx_ring);
sc->ether.rx_ring = NULL;
@@ -339,7 +339,8 @@ static int dc_init_descriptor_list(struct channel *sc)
SBE_2T3E3_RX_DESC_SECOND_ADDRESS_CHAINED | SBE_2T3E3_MTU;
if (sc->ether.rx_data[i] == NULL) {
- if (!(m = dev_alloc_skb(MCLBYTES))) {
+ m = dev_alloc_skb(MCLBYTES);
+ if (!m) {
for (j = 0; j < i; j++) {
dev_kfree_skb_any(sc->ether.rx_data[j]);
sc->ether.rx_data[j] = NULL;
diff --git a/drivers/staging/sbe-2t3e3/intr.c b/drivers/staging/sbe-2t3e3/intr.c
index efdeb7510047..1bf74b788008 100644
--- a/drivers/staging/sbe-2t3e3/intr.c
+++ b/drivers/staging/sbe-2t3e3/intr.c
@@ -118,7 +118,7 @@ void dc_intr_rx(struct channel *sc)
{
u32 current_read;
u32 error_mask, error;
- t3e3_rx_desc_t *current_desc;
+ struct t3e3_rx_desc *current_desc;
struct sk_buff *m, *m2;
unsigned rcv_len;
@@ -292,7 +292,7 @@ void dc_intr_tx(struct channel *sc)
{
u32 current_read, current_write;
u32 last_segment, error;
- t3e3_tx_desc_t *current_desc;
+ struct t3e3_tx_desc *current_desc;
spin_lock(&sc->ether.tx_lock);
diff --git a/drivers/staging/sbe-2t3e3/maps.c b/drivers/staging/sbe-2t3e3/maps.c
index 7084fbe7b794..e5494502cde1 100644
--- a/drivers/staging/sbe-2t3e3/maps.c
+++ b/drivers/staging/sbe-2t3e3/maps.c
@@ -13,8 +13,7 @@
#include <linux/kernel.h>
#include "2t3e3.h"
-const u32 cpld_reg_map[][2] =
-{
+const u32 cpld_reg_map[][2] = {
{ 0x0000, 0x0080 }, /* 0 - Port Control Register A (PCRA) */
{ 0x0004, 0x0084 }, /* 1 - Port Control Register B (PCRB) */
{ 0x0008, 0x0088 }, /* 2 - LCV Count Register (PLCR) */
@@ -35,8 +34,7 @@ const u32 cpld_reg_map[][2] =
{ 0x0070, 0x00f0 }, /* 17 - Port Bandwidth Stop (PBWL) */
};
-const u32 cpld_val_map[][2] =
-{
+const u32 cpld_val_map[][2] = {
{ 0x01, 0x02 }, /* LIU1 / LIU2 select for Serial Chip Select */
{ 0x04, 0x08 }, /* DAC1 / DAC2 select for Serial Chip Select */
{ 0x00, 0x04 }, /* LOOP1 / LOOP2 - select of loop timing source */
@@ -94,8 +92,7 @@ const u32 t3e3_framer_reg_map[] = {
0x81 /* 47 - LINE_INTERFACE_SCAN */
};
-const u32 t3e3_liu_reg_map[] =
-{
+const u32 t3e3_liu_reg_map[] = {
0x00, /* REG0 */
0x01, /* REG1 */
0x02, /* REG2 */
diff --git a/drivers/staging/sbe-2t3e3/module.c b/drivers/staging/sbe-2t3e3/module.c
index 0e32be5c2471..a6f93a43d216 100644
--- a/drivers/staging/sbe-2t3e3/module.c
+++ b/drivers/staging/sbe-2t3e3/module.c
@@ -122,7 +122,7 @@ static void t3e3_remove_card(struct pci_dev *pdev)
struct channel *channel0 = pci_get_drvdata(pdev);
struct card *card = channel0->card;
- del_timer(&card->timer);
+ del_timer_sync(&card->timer);
if (has_two_ports(channel0->pdev)) {
t3e3_remove_channel(&card->channels[1]);
pci_dev_put(card->channels[1].pdev);
diff --git a/drivers/staging/sbe-2t3e3/netdev.c b/drivers/staging/sbe-2t3e3/netdev.c
index 1f5088b3c10b..fe6c9513c9cd 100644
--- a/drivers/staging/sbe-2t3e3/netdev.c
+++ b/drivers/staging/sbe-2t3e3/netdev.c
@@ -25,8 +25,8 @@ static int t3e3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct channel *sc = dev_to_priv(dev);
int cmd_2t3e3, len, rlen;
- t3e3_param_t param;
- t3e3_resp_t resp;
+ struct t3e3_param param;
+ struct t3e3_resp resp;
void __user *data = ifr->ifr_data + sizeof(cmd_2t3e3) + sizeof(len);
if (cmd == SIOCWANDEV)
@@ -61,7 +61,7 @@ static struct net_device_stats *t3e3_get_stats(struct net_device *dev)
{
struct net_device_stats *nstats = &dev->stats;
struct channel *sc = dev_to_priv(dev);
- t3e3_stats_t *stats = &sc->s;
+ struct t3e3_stats *stats = &sc->s;
memset(nstats, 0, sizeof(struct net_device_stats));
nstats->rx_packets = stats->in_packets;