summaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/ambassador.c22
-rw-r--r--drivers/atm/firestream.c1
-rw-r--r--drivers/atm/fore200e.c110
-rw-r--r--drivers/atm/fore200e.h106
-rw-r--r--drivers/atm/he.c3
-rw-r--r--drivers/atm/horizon.c24
-rw-r--r--drivers/atm/idt77252.c6
-rw-r--r--drivers/atm/iphase.c9
-rw-r--r--drivers/atm/nicstar.c117
-rw-r--r--drivers/atm/nicstar.h12
10 files changed, 160 insertions, 250 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 7b44a596515..5aa12b011a9 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -437,7 +437,7 @@ static inline void dump_skb (char * prefix, unsigned int vc, struct sk_buff * sk
/* see limitations under Hardware Features */
-static inline int check_area (void * start, size_t length) {
+static int check_area (void * start, size_t length) {
// assumes length > 0
const u32 fourmegmask = -1 << 22;
const u32 twofivesixmask = -1 << 8;
@@ -456,7 +456,7 @@ static inline int check_area (void * start, size_t length) {
/********** free an skb (as per ATM device driver documentation) **********/
-static inline void amb_kfree_skb (struct sk_buff * skb) {
+static void amb_kfree_skb (struct sk_buff * skb) {
if (ATM_SKB(skb)->vcc->pop) {
ATM_SKB(skb)->vcc->pop (ATM_SKB(skb)->vcc, skb);
} else {
@@ -466,7 +466,7 @@ static inline void amb_kfree_skb (struct sk_buff * skb) {
/********** TX completion **********/
-static inline void tx_complete (amb_dev * dev, tx_out * tx) {
+static void tx_complete (amb_dev * dev, tx_out * tx) {
tx_simple * tx_descr = bus_to_virt (tx->handle);
struct sk_buff * skb = tx_descr->skb;
@@ -643,7 +643,7 @@ static int command_do (amb_dev * dev, command * cmd) {
/********** TX queue pair **********/
-static inline int tx_give (amb_dev * dev, tx_in * tx) {
+static int tx_give (amb_dev * dev, tx_in * tx) {
amb_txq * txq = &dev->txq;
unsigned long flags;
@@ -675,7 +675,7 @@ static inline int tx_give (amb_dev * dev, tx_in * tx) {
}
}
-static inline int tx_take (amb_dev * dev) {
+static int tx_take (amb_dev * dev) {
amb_txq * txq = &dev->txq;
unsigned long flags;
@@ -703,7 +703,7 @@ static inline int tx_take (amb_dev * dev) {
/********** RX queue pairs **********/
-static inline int rx_give (amb_dev * dev, rx_in * rx, unsigned char pool) {
+static int rx_give (amb_dev * dev, rx_in * rx, unsigned char pool) {
amb_rxq * rxq = &dev->rxq[pool];
unsigned long flags;
@@ -728,7 +728,7 @@ static inline int rx_give (amb_dev * dev, rx_in * rx, unsigned char pool) {
}
}
-static inline int rx_take (amb_dev * dev, unsigned char pool) {
+static int rx_take (amb_dev * dev, unsigned char pool) {
amb_rxq * rxq = &dev->rxq[pool];
unsigned long flags;
@@ -761,7 +761,7 @@ static inline int rx_take (amb_dev * dev, unsigned char pool) {
/********** RX Pool handling **********/
/* pre: buffers_wanted = 0, post: pending = 0 */
-static inline void drain_rx_pool (amb_dev * dev, unsigned char pool) {
+static void drain_rx_pool (amb_dev * dev, unsigned char pool) {
amb_rxq * rxq = &dev->rxq[pool];
PRINTD (DBG_FLOW|DBG_POOL, "drain_rx_pool %p %hu", dev, pool);
@@ -796,7 +796,7 @@ static void drain_rx_pools (amb_dev * dev) {
drain_rx_pool (dev, pool);
}
-static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
+static void fill_rx_pool (amb_dev * dev, unsigned char pool,
gfp_t priority)
{
rx_in rx;
@@ -846,7 +846,7 @@ static void fill_rx_pools (amb_dev * dev) {
/********** enable host interrupts **********/
-static inline void interrupts_on (amb_dev * dev) {
+static void interrupts_on (amb_dev * dev) {
wr_plain (dev, offsetof(amb_mem, interrupt_control),
rd_plain (dev, offsetof(amb_mem, interrupt_control))
| AMB_INTERRUPT_BITS);
@@ -854,7 +854,7 @@ static inline void interrupts_on (amb_dev * dev) {
/********** disable host interrupts **********/
-static inline void interrupts_off (amb_dev * dev) {
+static void interrupts_off (amb_dev * dev) {
wr_plain (dev, offsetof(amb_mem, interrupt_control),
rd_plain (dev, offsetof(amb_mem, interrupt_control))
&~ AMB_INTERRUPT_BITS);
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 47c57a4294b..98099f526d8 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -978,6 +978,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
/* Docs are vague about this atm_hdr field. By the way, the FS
* chip makes odd errors if lower bits are set.... -- REW */
tc->atm_hdr = (vpi << 20) | (vci << 4);
+ tmc0 = 0;
{
int pcr = atm_pcr_goal (txtp);
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 9427a61f62b..432181ed7bb 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -1988,19 +1988,19 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg)
if (fore200e_getstats(fore200e) < 0)
return -EIO;
- tmp.section_bip = cpu_to_be32(fore200e->stats->oc3.section_bip8_errors);
- tmp.line_bip = cpu_to_be32(fore200e->stats->oc3.line_bip24_errors);
- tmp.path_bip = cpu_to_be32(fore200e->stats->oc3.path_bip8_errors);
- tmp.line_febe = cpu_to_be32(fore200e->stats->oc3.line_febe_errors);
- tmp.path_febe = cpu_to_be32(fore200e->stats->oc3.path_febe_errors);
- tmp.corr_hcs = cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors);
- tmp.uncorr_hcs = cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors);
- tmp.tx_cells = cpu_to_be32(fore200e->stats->aal0.cells_transmitted) +
- cpu_to_be32(fore200e->stats->aal34.cells_transmitted) +
- cpu_to_be32(fore200e->stats->aal5.cells_transmitted);
- tmp.rx_cells = cpu_to_be32(fore200e->stats->aal0.cells_received) +
- cpu_to_be32(fore200e->stats->aal34.cells_received) +
- cpu_to_be32(fore200e->stats->aal5.cells_received);
+ tmp.section_bip = be32_to_cpu(fore200e->stats->oc3.section_bip8_errors);
+ tmp.line_bip = be32_to_cpu(fore200e->stats->oc3.line_bip24_errors);
+ tmp.path_bip = be32_to_cpu(fore200e->stats->oc3.path_bip8_errors);
+ tmp.line_febe = be32_to_cpu(fore200e->stats->oc3.line_febe_errors);
+ tmp.path_febe = be32_to_cpu(fore200e->stats->oc3.path_febe_errors);
+ tmp.corr_hcs = be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors);
+ tmp.uncorr_hcs = be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors);
+ tmp.tx_cells = be32_to_cpu(fore200e->stats->aal0.cells_transmitted) +
+ be32_to_cpu(fore200e->stats->aal34.cells_transmitted) +
+ be32_to_cpu(fore200e->stats->aal5.cells_transmitted);
+ tmp.rx_cells = be32_to_cpu(fore200e->stats->aal0.cells_received) +
+ be32_to_cpu(fore200e->stats->aal34.cells_received) +
+ be32_to_cpu(fore200e->stats->aal5.cells_received);
if (arg)
return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0;
@@ -2587,7 +2587,7 @@ fore200e_start_fw(struct fore200e* fore200e)
static int __devinit
fore200e_load_fw(struct fore200e* fore200e)
{
- u32* fw_data = (u32*) fore200e->bus->fw_data;
+ __le32* fw_data = (__le32*) fore200e->bus->fw_data;
u32 fw_size = (u32) *fore200e->bus->fw_size / sizeof(u32);
struct fw_header* fw_header = (struct fw_header*) fw_data;
@@ -2965,8 +2965,8 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" 4b5b:\n"
" crc_header_errors:\t\t%10u\n"
" framing_errors:\t\t%10u\n",
- cpu_to_be32(fore200e->stats->phy.crc_header_errors),
- cpu_to_be32(fore200e->stats->phy.framing_errors));
+ be32_to_cpu(fore200e->stats->phy.crc_header_errors),
+ be32_to_cpu(fore200e->stats->phy.framing_errors));
if (!left--)
return sprintf(page, "\n"
@@ -2978,13 +2978,13 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" path_febe_errors:\t\t%10u\n"
" corr_hcs_errors:\t\t%10u\n"
" ucorr_hcs_errors:\t\t%10u\n",
- cpu_to_be32(fore200e->stats->oc3.section_bip8_errors),
- cpu_to_be32(fore200e->stats->oc3.path_bip8_errors),
- cpu_to_be32(fore200e->stats->oc3.line_bip24_errors),
- cpu_to_be32(fore200e->stats->oc3.line_febe_errors),
- cpu_to_be32(fore200e->stats->oc3.path_febe_errors),
- cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors),
- cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors));
+ be32_to_cpu(fore200e->stats->oc3.section_bip8_errors),
+ be32_to_cpu(fore200e->stats->oc3.path_bip8_errors),
+ be32_to_cpu(fore200e->stats->oc3.line_bip24_errors),
+ be32_to_cpu(fore200e->stats->oc3.line_febe_errors),
+ be32_to_cpu(fore200e->stats->oc3.path_febe_errors),
+ be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors),
+ be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors));
if (!left--)
return sprintf(page,"\n"
@@ -2995,12 +2995,12 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" vpi no conn:\t\t%10u\n"
" vci out of range:\t\t%10u\n"
" vci no conn:\t\t%10u\n",
- cpu_to_be32(fore200e->stats->atm.cells_transmitted),
- cpu_to_be32(fore200e->stats->atm.cells_received),
- cpu_to_be32(fore200e->stats->atm.vpi_bad_range),
- cpu_to_be32(fore200e->stats->atm.vpi_no_conn),
- cpu_to_be32(fore200e->stats->atm.vci_bad_range),
- cpu_to_be32(fore200e->stats->atm.vci_no_conn));
+ be32_to_cpu(fore200e->stats->atm.cells_transmitted),
+ be32_to_cpu(fore200e->stats->atm.cells_received),
+ be32_to_cpu(fore200e->stats->atm.vpi_bad_range),
+ be32_to_cpu(fore200e->stats->atm.vpi_no_conn),
+ be32_to_cpu(fore200e->stats->atm.vci_bad_range),
+ be32_to_cpu(fore200e->stats->atm.vci_no_conn));
if (!left--)
return sprintf(page,"\n"
@@ -3008,9 +3008,9 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" TX:\t\t\t%10u\n"
" RX:\t\t\t%10u\n"
" dropped:\t\t\t%10u\n",
- cpu_to_be32(fore200e->stats->aal0.cells_transmitted),
- cpu_to_be32(fore200e->stats->aal0.cells_received),
- cpu_to_be32(fore200e->stats->aal0.cells_dropped));
+ be32_to_cpu(fore200e->stats->aal0.cells_transmitted),
+ be32_to_cpu(fore200e->stats->aal0.cells_received),
+ be32_to_cpu(fore200e->stats->aal0.cells_dropped));
if (!left--)
return sprintf(page,"\n"
@@ -3026,15 +3026,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" RX:\t\t\t%10u\n"
" dropped:\t\t\t%10u\n"
" protocol errors:\t\t%10u\n",
- cpu_to_be32(fore200e->stats->aal34.cells_transmitted),
- cpu_to_be32(fore200e->stats->aal34.cells_received),
- cpu_to_be32(fore200e->stats->aal34.cells_dropped),
- cpu_to_be32(fore200e->stats->aal34.cells_crc_errors),
- cpu_to_be32(fore200e->stats->aal34.cells_protocol_errors),
- cpu_to_be32(fore200e->stats->aal34.cspdus_transmitted),
- cpu_to_be32(fore200e->stats->aal34.cspdus_received),
- cpu_to_be32(fore200e->stats->aal34.cspdus_dropped),
- cpu_to_be32(fore200e->stats->aal34.cspdus_protocol_errors));
+ be32_to_cpu(fore200e->stats->aal34.cells_transmitted),
+ be32_to_cpu(fore200e->stats->aal34.cells_received),
+ be32_to_cpu(fore200e->stats->aal34.cells_dropped),
+ be32_to_cpu(fore200e->stats->aal34.cells_crc_errors),
+ be32_to_cpu(fore200e->stats->aal34.cells_protocol_errors),
+ be32_to_cpu(fore200e->stats->aal34.cspdus_transmitted),
+ be32_to_cpu(fore200e->stats->aal34.cspdus_received),
+ be32_to_cpu(fore200e->stats->aal34.cspdus_dropped),
+ be32_to_cpu(fore200e->stats->aal34.cspdus_protocol_errors));
if (!left--)
return sprintf(page,"\n"
@@ -3050,15 +3050,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" dropped:\t\t\t%10u\n"
" CRC errors:\t\t%10u\n"
" protocol errors:\t\t%10u\n",
- cpu_to_be32(fore200e->stats->aal5.cells_transmitted),
- cpu_to_be32(fore200e->stats->aal5.cells_received),
- cpu_to_be32(fore200e->stats->aal5.cells_dropped),
- cpu_to_be32(fore200e->stats->aal5.congestion_experienced),
- cpu_to_be32(fore200e->stats->aal5.cspdus_transmitted),
- cpu_to_be32(fore200e->stats->aal5.cspdus_received),
- cpu_to_be32(fore200e->stats->aal5.cspdus_dropped),
- cpu_to_be32(fore200e->stats->aal5.cspdus_crc_errors),
- cpu_to_be32(fore200e->stats->aal5.cspdus_protocol_errors));
+ be32_to_cpu(fore200e->stats->aal5.cells_transmitted),
+ be32_to_cpu(fore200e->stats->aal5.cells_received),
+ be32_to_cpu(fore200e->stats->aal5.cells_dropped),
+ be32_to_cpu(fore200e->stats->aal5.congestion_experienced),
+ be32_to_cpu(fore200e->stats->aal5.cspdus_transmitted),
+ be32_to_cpu(fore200e->stats->aal5.cspdus_received),
+ be32_to_cpu(fore200e->stats->aal5.cspdus_dropped),
+ be32_to_cpu(fore200e->stats->aal5.cspdus_crc_errors),
+ be32_to_cpu(fore200e->stats->aal5.cspdus_protocol_errors));
if (!left--)
return sprintf(page,"\n"
@@ -3069,11 +3069,11 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
" large b2:\t\t\t%10u\n"
" RX PDUs:\t\t\t%10u\n"
" TX PDUs:\t\t\t%10lu\n",
- cpu_to_be32(fore200e->stats->aux.small_b1_failed),
- cpu_to_be32(fore200e->stats->aux.large_b1_failed),
- cpu_to_be32(fore200e->stats->aux.small_b2_failed),
- cpu_to_be32(fore200e->stats->aux.large_b2_failed),
- cpu_to_be32(fore200e->stats->aux.rpd_alloc_failed),
+ be32_to_cpu(fore200e->stats->aux.small_b1_failed),
+ be32_to_cpu(fore200e->stats->aux.large_b1_failed),
+ be32_to_cpu(fore200e->stats->aux.small_b2_failed),
+ be32_to_cpu(fore200e->stats->aux.large_b2_failed),
+ be32_to_cpu(fore200e->stats->aux.rpd_alloc_failed),
fore200e->tx_sat);
if (!left--)
diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
index b85a54613de..183841cc8fd 100644
--- a/drivers/atm/fore200e.h
+++ b/drivers/atm/fore200e.h
@@ -349,90 +349,90 @@ typedef struct oc3_block {
/* physical encoding statistics */
typedef struct stats_phy {
- u32 crc_header_errors; /* cells received with bad header CRC */
- u32 framing_errors; /* cells received with bad framing */
- u32 pad[ 2 ]; /* i960 padding */
+ __be32 crc_header_errors; /* cells received with bad header CRC */
+ __be32 framing_errors; /* cells received with bad framing */
+ __be32 pad[ 2 ]; /* i960 padding */
} stats_phy_t;
/* OC-3 statistics */
typedef struct stats_oc3 {
- u32 section_bip8_errors; /* section 8 bit interleaved parity */
- u32 path_bip8_errors; /* path 8 bit interleaved parity */
- u32 line_bip24_errors; /* line 24 bit interleaved parity */
- u32 line_febe_errors; /* line far end block errors */
- u32 path_febe_errors; /* path far end block errors */
- u32 corr_hcs_errors; /* correctable header check sequence */
- u32 ucorr_hcs_errors; /* uncorrectable header check sequence */
- u32 pad[ 1 ]; /* i960 padding */
+ __be32 section_bip8_errors; /* section 8 bit interleaved parity */
+ __be32 path_bip8_errors; /* path 8 bit interleaved parity */
+ __be32 line_bip24_errors; /* line 24 bit interleaved parity */
+ __be32 line_febe_errors; /* line far end block errors */
+ __be32 path_febe_errors; /* path far end block errors */
+ __be32 corr_hcs_errors; /* correctable header check sequence */
+ __be32 ucorr_hcs_errors; /* uncorrectable header check sequence */
+ __be32 pad[ 1 ]; /* i960 padding */
} stats_oc3_t;
/* ATM statistics */
typedef struct stats_atm {
- u32 cells_transmitted; /* cells transmitted */
- u32 cells_received; /* cells received */
- u32 vpi_bad_range; /* cell drops: VPI out of range */
- u32 vpi_no_conn; /* cell drops: no connection for VPI */
- u32 vci_bad_range; /* cell drops: VCI out of range */
- u32 vci_no_conn; /* cell drops: no connection for VCI */
- u32 pad[ 2 ]; /* i960 padding */
+ __be32 cells_transmitted; /* cells transmitted */
+ __be32 cells_received; /* cells received */
+ __be32 vpi_bad_range; /* cell drops: VPI out of range */
+ __be32 vpi_no_conn; /* cell drops: no connection for VPI */
+ __be32 vci_bad_range; /* cell drops: VCI out of range */
+ __be32 vci_no_conn; /* cell drops: no connection for VCI */
+ __be32 pad[ 2 ]; /* i960 padding */
} stats_atm_t;
/* AAL0 statistics */
typedef struct stats_aal0 {
- u32 cells_transmitted; /* cells transmitted */
- u32 cells_received; /* cells received */
- u32 cells_dropped; /* cells dropped */
- u32 pad[ 1 ]; /* i960 padding */
+ __be32 cells_transmitted; /* cells transmitted */
+ __be32 cells_received; /* cells received */
+ __be32 cells_dropped; /* cells dropped */
+ __be32 pad[ 1 ]; /* i960 padding */
} stats_aal0_t;
/* AAL3/4 statistics */
typedef struct stats_aal34 {
- u32 cells_transmitted; /* cells transmitted from segmented PDUs */
- u32 cells_received; /* cells reassembled into PDUs */
- u32 cells_crc_errors; /* payload CRC error count */
- u32 cells_protocol_errors; /* SAR or CS layer protocol errors */
- u32 cells_dropped; /* cells dropped: partial reassembly */
- u32 cspdus_transmitted; /* CS PDUs transmitted */
- u32 cspdus_received; /* CS PDUs received */
- u32 cspdus_protocol_errors; /* CS layer protocol errors */
- u32 cspdus_dropped; /* reassembled PDUs drop'd (in cells) */
- u32 pad[ 3 ]; /* i960 padding */
+ __be32 cells_transmitted; /* cells transmitted from segmented PDUs */
+ __be32 cells_received; /* cells reassembled into PDUs */
+ __be32 cells_crc_errors; /* payload CRC error count */
+ __be32 cells_protocol_errors; /* SAR or CS layer protocol errors */
+ __be32 cells_dropped; /* cells dropped: partial reassembly */
+ __be32 cspdus_transmitted; /* CS PDUs transmitted */
+ __be32 cspdus_received; /* CS PDUs received */
+ __be32 cspdus_protocol_errors; /* CS layer protocol errors */
+ __be32 cspdus_dropped; /* reassembled PDUs drop'd (in cells) */
+ __be32 pad[ 3 ]; /* i960 padding */
} stats_aal34_t;
/* AAL5 statistics */
typedef struct stats_aal5 {
- u32 cells_transmitted; /* cells transmitted from segmented SDUs */
- u32 cells_received; /* cells reassembled into SDUs */
- u32 cells_dropped; /* reassembled PDUs dropped (in cells) */
- u32 congestion_experienced; /* CRC error and length wrong */
- u32 cspdus_transmitted; /* CS PDUs transmitted */
- u32 cspdus_received; /* CS PDUs received */
- u32 cspdus_crc_errors; /* CS PDUs CRC errors */
- u32 cspdus_protocol_errors; /* CS layer protocol errors */
- u32 cspdus_dropped; /* reassembled PDUs dropped */
- u32 pad[ 3 ]; /* i960 padding */
+ __be32 cells_transmitted; /* cells transmitted from segmented SDUs */
+ __be32 cells_received; /* cells reassembled into SDUs */
+ __be32 cells_dropped; /* reassembled PDUs dropped (in cells) */
+ __be32 congestion_experienced; /* CRC error and length wrong */
+ __be32 cspdus_transmitted; /* CS PDUs transmitted */
+ __be32 cspdus_received; /* CS PDUs received */
+ __be32 cspdus_crc_errors; /* CS PDUs CRC errors */
+ __be32 cspdus_protocol_errors; /* CS layer protocol errors */
+ __be32 cspdus_dropped; /* reassembled PDUs dropped */
+ __be32 pad[ 3 ]; /* i960 padding */
} stats_aal5_t;
/* auxiliary statistics */
typedef struct stats_aux {
- u32 small_b1_failed; /* receive BD allocation failures */
- u32 large_b1_failed; /* receive BD allocation failures */
- u32 small_b2_failed; /* receive BD allocation failures */
- u32 large_b2_failed; /* receive BD allocation failures */
- u32 rpd_alloc_failed; /* receive PDU allocation failures */
- u32 receive_carrier; /* no carrier = 0, carrier = 1 */
- u32 pad[ 2 ]; /* i960 padding */
+ __be32 small_b1_failed; /* receive BD allocation failures */
+ __be32 large_b1_failed; /* receive BD allocation failures */
+ __be32 small_b2_failed; /* receive BD allocation failures */
+ __be32 large_b2_failed; /* receive BD allocation failures */
+ __be32 rpd_alloc_failed; /* receive PDU allocation failures */
+ __be32 receive_carrier; /* no carrier = 0, carrier = 1 */
+ __be32 pad[ 2 ]; /* i960 padding */
} stats_aux_t;
@@ -643,10 +643,10 @@ typedef struct host_bsq {
/* header of the firmware image */
typedef struct fw_header {
- u32 magic; /* magic number */
- u32 version; /* firmware version id */
- u32 load_offset; /* fw load offset in board memory */
- u32 start_offset; /* fw execution start address in board memory */
+ __le32 magic; /* magic number */
+ __le32 version; /* firmware version id */
+ __le32 load_offset; /* fw load offset in board memory */
+ __le32 start_offset; /* fw execution start address in board memory */
} fw_header_t;
#define FW_HEADER_MAGIC 0x65726f66 /* 'fore' */
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 2e3395b7e8c..ffc4a5a4194 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -3000,8 +3000,7 @@ he_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
/* eeprom routines -- see 4.7 */
-u8
-read_prom_byte(struct he_dev *he_dev, int addr)
+static u8 read_prom_byte(struct he_dev *he_dev, int addr)
{
u32 val = 0, tmp_read = 0;
int i, j = 0;
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 9b2cf253f02..c0ac728dc56 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -424,7 +424,7 @@ static inline void FLUSH_RX_CHANNEL (hrz_dev * dev, u16 channel) {
return;
}
-static inline void WAIT_FLUSH_RX_COMPLETE (hrz_dev * dev) {
+static void WAIT_FLUSH_RX_COMPLETE (hrz_dev * dev) {
while (rd_regw (dev, RX_CHANNEL_PORT_OFF) & FLUSH_CHANNEL)
;
return;
@@ -435,7 +435,7 @@ static inline void SELECT_RX_CHANNEL (hrz_dev * dev, u16 channel) {
return;
}
-static inline void WAIT_UPDATE_COMPLETE (hrz_dev * dev) {
+static void WAIT_UPDATE_COMPLETE (hrz_dev * dev) {
while (rd_regw (dev, RX_CHANNEL_PORT_OFF) & RX_CHANNEL_UPDATE_IN_PROGRESS)
;
return;
@@ -796,7 +796,7 @@ static void hrz_change_vc_qos (ATM_RXER * rxer, MAAL_QOS * qos) {
/********** free an skb (as per ATM device driver documentation) **********/
-static inline void hrz_kfree_skb (struct sk_buff * skb) {
+static void hrz_kfree_skb (struct sk_buff * skb) {
if (ATM_SKB(skb)->vcc->pop) {
ATM_SKB(skb)->vcc->pop (ATM_SKB(skb)->vcc, skb);
} else {
@@ -1076,7 +1076,7 @@ static void rx_schedule (hrz_dev * dev, int irq) {
/********** handle RX bus master complete events **********/
-static inline void rx_bus_master_complete_handler (hrz_dev * dev) {
+static void rx_bus_master_complete_handler (hrz_dev * dev) {
if (test_bit (rx_busy, &dev->flags)) {
rx_schedule (dev, 1);
} else {
@@ -1089,7 +1089,7 @@ static inline void rx_bus_master_complete_handler (hrz_dev * dev) {
/********** (queue to) become the next TX thread **********/
-static inline int tx_hold (hrz_dev * dev) {
+static int tx_hold (hrz_dev * dev) {
PRINTD (DBG_TX, "sleeping at tx lock %p %lu", dev, dev->flags);
wait_event_interruptible(dev->tx_queue, (!test_and_set_bit(tx_busy, &dev->flags)));
PRINTD (DBG_TX, "woken at tx lock %p %lu", dev, dev->flags);
@@ -1232,7 +1232,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
/********** handle TX bus master complete events **********/
-static inline void tx_bus_master_complete_handler (hrz_dev * dev) {
+static void tx_bus_master_complete_handler (hrz_dev * dev) {
if (test_bit (tx_busy, &dev->flags)) {
tx_schedule (dev, 1);
} else {
@@ -1246,7 +1246,7 @@ static inline void tx_bus_master_complete_handler (hrz_dev * dev) {
/********** move RX Q pointer to next item in circular buffer **********/
// called only from IRQ sub-handler
-static inline u32 rx_queue_entry_next (hrz_dev * dev) {
+static u32 rx_queue_entry_next (hrz_dev * dev) {
u32 rx_queue_entry;
spin_lock (&dev->mem_lock);
rx_queue_entry = rd_mem (dev, &dev->rx_q_entry->entry);
@@ -1270,7 +1270,7 @@ static inline void rx_disabled_handler (hrz_dev * dev) {
/********** handle RX data received by device **********/
// called from IRQ handler
-static inline void rx_data_av_handler (hrz_dev * dev) {
+static void rx_data_av_handler (hrz_dev * dev) {
u32 rx_queue_entry;
u32 rx_queue_entry_flags;
u16 rx_len;
@@ -1394,7 +1394,7 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id)
irq_ok = 0;
while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF)
& INTERESTING_INTERRUPTS)) {
- // In the interests of fairness, the (inline) handlers below are
+ // In the interests of fairness, the handlers below are
// called in sequence and without immediate return to the head of
// the while loop. This is only of issue for slow hosts (or when
// debugging messages are on). Really slow hosts may find a fast
@@ -1458,7 +1458,7 @@ static void do_housekeeping (unsigned long arg) {
/********** find an idle channel for TX and set it up **********/
// called with tx_busy set
-static inline short setup_idle_tx_channel (hrz_dev * dev, hrz_vcc * vcc) {
+static short setup_idle_tx_channel (hrz_dev * dev, hrz_vcc * vcc) {
unsigned short idle_channels;
short tx_channel = -1;
unsigned int spin_count;
@@ -1777,13 +1777,13 @@ static void hrz_reset (const hrz_dev * dev) {
/********** read the burnt in address **********/
-static inline void WRITE_IT_WAIT (const hrz_dev *dev, u32 ctrl)
+static void WRITE_IT_WAIT (const hrz_dev *dev, u32 ctrl)
{
wr_regl (dev, CONTROL_0_REG, ctrl);
udelay (5);
}
-static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl)
+static void CLOCK_IT (const hrz_dev *dev, u32 ctrl)
{
// DI must be valid around rising SK edge
WRITE_IT_WAIT(dev, ctrl & ~SEEPROM_SK);
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b967919fb7e..28d77b5195d 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -2016,8 +2016,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam)
return 0;
}
-int
-idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb)
+static int idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb)
{
return idt77252_send_skb(vcc, skb, 0);
}
@@ -3072,8 +3071,7 @@ idt77252_dev_open(struct idt77252_dev *card)
return 0;
}
-void
-idt77252_dev_close(struct atm_dev *dev)
+static void idt77252_dev_close(struct atm_dev *dev)
{
struct idt77252_dev *card = dev->dev_data;
u32 conf;
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index ef52452640e..5c28ca7380f 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -60,7 +60,8 @@
#include <asm/uaccess.h>
#include <asm/string.h>
#include <asm/byteorder.h>
-#include <linux/vmalloc.h>
+#include <linux/vmalloc.h>
+#include <linux/jiffies.h>
#include "iphase.h"
#include "suni.h"
#define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))
@@ -189,7 +190,7 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
int ltimeout;
ia_hack_tcq (dev);
- if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){
+ if((time_after(jiffies,timer+50)) || ((dev->ffL.tcq_rd==dev->host_tcq_wr))) {
timer = jiffies;
i=0;
while (i < dev->num_tx_desc) {
@@ -958,6 +959,7 @@ static void ia_suni_pm7345_init (IADEV *iadev)
/***************************** IA_LIB END *****************************/
+#ifdef CONFIG_ATM_IA_DEBUG
static int tcnter = 0;
static void xdump( u_char* cp, int length, char* prefix )
{
@@ -992,6 +994,7 @@ static void xdump( u_char* cp, int length, char* prefix )
}
} /* close xdump(... */
+#endif /* CONFIG_ATM_IA_DEBUG */
static struct atm_dev *ia_boards = NULL;
@@ -1223,7 +1226,7 @@ static void rx_intr(struct atm_dev *dev)
iadev->rx_tmp_jif = jiffies;
iadev->rxing = 0;
}
- else if (((jiffies - iadev->rx_tmp_jif) > 50) &&
+ else if ((time_after(jiffies, iadev->rx_tmp_jif + 50)) &&
((iadev->rx_pkt_cnt - iadev->rx_tmp_cnt) == 0)) {
for (i = 1; i <= iadev->num_rx_desc; i++)
free_desc(dev, i);
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 0c205b000e8..38c769f8d2b 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -125,85 +125,6 @@
#define ATM_SKB(s) (&(s)->atm)
#endif
- /* Spinlock debugging stuff */
-#ifdef NS_DEBUG_SPINLOCKS /* See nicstar.h */
-#define ns_grab_int_lock(card,flags) \
- do { \
- unsigned long nsdsf, nsdsf2; \
- local_irq_save(flags); \
- save_flags(nsdsf); cli();\
- if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
- (flags)&(1<<9)?"en":"dis"); \
- if (spin_is_locked(&(card)->int_lock) && \
- (card)->cpu_int == smp_processor_id()) { \
- printk("nicstar.c: line %d (cpu %d) int_lock already locked at line %d (cpu %d)\n", \
- __LINE__, smp_processor_id(), (card)->has_int_lock, \
- (card)->cpu_int); \
- printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
- } \
- if (spin_is_locked(&(card)->res_lock) && \
- (card)->cpu_res == smp_processor_id()) { \
- printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying int)\n", \
- __LINE__, smp_processor_id(), (card)->has_res_lock, \
- (card)->cpu_res); \
- printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
- } \
- spin_lock_irq(&(card)->int_lock); \
- (card)->has_int_lock = __LINE__; \
- (card)->cpu_int = smp_processor_id(); \
- restore_flags(nsdsf); } while (0)
-#define ns_grab_res_lock(card,flags) \
- do { \
- unsigned long nsdsf, nsdsf2; \
- local_irq_save(flags); \
- save_flags(nsdsf); cli();\
- if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
- (flags)&(1<<9)?"en":"dis"); \
- if (spin_is_locked(&(card)->res_lock) && \
- (card)->cpu_res == smp_processor_id()) { \
- printk("nicstar.c: line %d (cpu %d) res_lock already locked at line %d (cpu %d)\n", \
- __LINE__, smp_processor_id(), (card)->has_res_lock, \
- (card)->cpu_res); \
- printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
- } \
- spin_lock_irq(&(card)->res_lock); \
- (card)->has_res_lock = __LINE__; \
- (card)->cpu_res = smp_processor_id(); \
- restore_flags(nsdsf); } while (0)
-#define ns_grab_scq_lock(card,scq,flags) \
- do { \
- unsigned long nsdsf, nsdsf2; \
- local_irq_save(flags); \
- save_flags(nsdsf); cli();\
- if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
- (flags)&(1<<9)?"en":"dis"); \
- if (spin_is_locked(&(scq)->lock) && \
- (scq)->cpu_lock == smp_processor_id()) { \
- printk("nicstar.c: line %d (cpu %d) this scq_lock already locked at line %d (cpu %d)\n", \
- __LINE__, smp_processor_id(), (scq)->has_lock, \
- (scq)->cpu_lock); \
- printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
- } \
- if (spin_is_locked(&(card)->res_lock) && \
- (card)->cpu_res == smp_processor_id()) { \
- printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying scq)\n", \
- __LINE__, smp_processor_id(), (card)->has_res_lock, \
- (card)->cpu_res); \
- printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
- } \
- spin_lock_irq(&(scq)->lock); \
- (scq)->has_lock = __LINE__; \
- (scq)->cpu_lock = smp_processor_id(); \
- restore_flags(nsdsf); } while (0)
-#else /* !NS_DEBUG_SPINLOCKS */
-#define ns_grab_int_lock(card,flags) \
- spin_lock_irqsave(&(card)->int_lock,(flags))
-#define ns_grab_res_lock(card,flags) \
- spin_lock_irqsave(&(card)->res_lock,(flags))
-#define ns_grab_scq_lock(card,scq,flags) \
- spin_lock_irqsave(&(scq)->lock,flags)
-#endif /* NS_DEBUG_SPINLOCKS */
-
/* Function declarations ******************************************************/
@@ -422,7 +343,7 @@ static u32 ns_read_sram(ns_dev *card, u32 sram_address)
sram_address <<= 2;
sram_address &= 0x0007FFFC; /* address must be dword aligned */
sram_address |= 0x50000000; /* SRAM read command */
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while (CMD_BUSY(card));
writel(sram_address, card->membase + CMD);
while (CMD_BUSY(card));
@@ -440,7 +361,7 @@ static void ns_write_sram(ns_dev *card, u32 sram_address, u32 *value, int count)
count--; /* count range now is 0..3 instead of 1..4 */
c = count;
c <<= 2; /* to use increments of 4 */
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while (CMD_BUSY(card));
for (i = 0; i <= c; i += 4)
writel(*(value++), card->membase + i);
@@ -1166,7 +1087,7 @@ static void push_rxbufs(ns_dev *card, struct sk_buff *skb)
card->lbfqc += 2;
}
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while (CMD_BUSY(card));
writel(addr2, card->membase + DR3);
@@ -1206,7 +1127,7 @@ static irqreturn_t ns_irq_handler(int irq, void *dev_id)
PRINTK("nicstar%d: NICStAR generated an interrupt\n", card->index);
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
stat_r = readl(card->membase + STAT);
@@ -1585,7 +1506,7 @@ static void ns_close(struct atm_vcc *vcc)
unsigned long flags;
addr = NS_RCT + (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE;
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while(CMD_BUSY(card));
writel(NS_CMD_CLOSE_CONNECTION | addr << 2, card->membase + CMD);
spin_unlock_irqrestore(&card->res_lock, flags);
@@ -1607,7 +1528,7 @@ static void ns_close(struct atm_vcc *vcc)
NS_SKB(iovb)->iovcnt);
NS_SKB(iovb)->iovcnt = 0;
NS_SKB(iovb)->vcc = NULL;
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
recycle_iov_buf(card, iovb);
spin_unlock_irqrestore(&card->int_lock, flags);
vc->rx_iov = NULL;
@@ -1629,7 +1550,7 @@ static void ns_close(struct atm_vcc *vcc)
for (;;)
{
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
scqep = scq->next;
if (scqep == scq->base)
scqep = scq->last;
@@ -1691,7 +1612,7 @@ static void ns_close(struct atm_vcc *vcc)
unsigned long flags;
scq_info *scq = card->scq0;
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
for(i = 0; i < scq->num_entries; i++) {
if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) {
@@ -1892,7 +1813,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
u32 data;
int index;
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
while (scq->tail == scq->next)
{
if (in_interrupt()) {
@@ -1904,7 +1825,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
scq->full = 1;
spin_unlock_irqrestore(&scq->lock, flags);
interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
if (scq->full) {
spin_unlock_irqrestore(&scq->lock, flags);
@@ -1953,7 +1874,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
if (has_run++) break;
spin_unlock_irqrestore(&scq->lock, flags);
interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
}
if (!scq->full)
@@ -2090,7 +2011,7 @@ static void drain_scq(ns_dev *card, scq_info *scq, int pos)
return;
}
- ns_grab_scq_lock(card, scq, flags);
+ spin_lock_irqsave(&scq->lock, flags);
i = (int) (scq->tail - scq->base);
if (++i == scq->num_entries)
i = 0;
@@ -2898,7 +2819,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
{
struct sk_buff *hb;
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
hb = skb_dequeue(&card->hbpool.queue);
card->hbpool.count--;
spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2917,7 +2838,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
if (hb == NULL)
return -ENOMEM;
NS_SKB_CB(hb)->buf_type = BUF_NONE;
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
skb_queue_tail(&card->hbpool.queue, hb);
card->hbpool.count++;
spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2929,7 +2850,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
{
struct sk_buff *iovb;
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
iovb = skb_dequeue(&card->iovpool.queue);
card->iovpool.count--;
spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2948,7 +2869,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
if (iovb == NULL)
return -ENOMEM;
NS_SKB_CB(iovb)->buf_type = BUF_NONE;
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
skb_queue_tail(&card->iovpool.queue, iovb);
card->iovpool.count++;
spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2995,7 +2916,7 @@ static void ns_poll(unsigned long arg)
/* Probably it isn't worth spinning */
continue;
}
- ns_grab_int_lock(card, flags);
+ spin_lock_irqsave(&card->int_lock, flags);
stat_w = 0;
stat_r = readl(card->membase + STAT);
@@ -3062,7 +2983,7 @@ static void ns_phy_put(struct atm_dev *dev, unsigned char value,
unsigned long flags;
card = dev->dev_data;
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while(CMD_BUSY(card));
writel((unsigned long) value, card->membase + DR0);
writel(NS_CMD_WRITE_UTILITY | 0x00000200 | (addr & 0x000000FF),
@@ -3079,7 +3000,7 @@ static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr)
unsigned long data;
card = dev->dev_data;
- ns_grab_res_lock(card, flags);
+ spin_lock_irqsave(&card->res_lock, flags);
while(CMD_BUSY(card));
writel(NS_CMD_READ_UTILITY | 0x00000200 | (addr & 0x000000FF),
card->membase + CMD);
diff --git a/drivers/atm/nicstar.h b/drivers/atm/nicstar.h
index 5997bcb45b5..6010e3daa6a 100644
--- a/drivers/atm/nicstar.h
+++ b/drivers/atm/nicstar.h
@@ -28,8 +28,6 @@
/* Options ********************************************************************/
-#undef NS_DEBUG_SPINLOCKS
-
#define NS_MAX_CARDS 4 /* Maximum number of NICStAR based cards
controlled by the device driver. Must
be <= 5 */
@@ -721,10 +719,6 @@ typedef struct scq_info
wait_queue_head_t scqfull_waitq;
volatile char full; /* SCQ full indicator */
spinlock_t lock; /* SCQ spinlock */
-#ifdef NS_DEBUG_SPINLOCKS
- volatile long has_lock;
- volatile int cpu_lock;
-#endif /* NS_DEBUG_SPINLOCKS */
} scq_info;
@@ -810,12 +804,6 @@ typedef struct ns_dev
unsigned intcnt; /* Interrupt counter */
spinlock_t int_lock; /* Interrupt lock */
spinlock_t res_lock; /* Card resource lock */
-#ifdef NS_DEBUG_SPINLOCKS
- volatile long has_int_lock;
- volatile int cpu_int;
- volatile long has_res_lock;
- volatile int cpu_res;
-#endif /* NS_DEBUG_SPINLOCKS */
} ns_dev;