ia64/xen-unstable

changeset 1317:1acac2de0d7c

bitkeeper revision 1.877 (408a2112twZvxfjh5flm0x6eryHUPw)

Fix crash in e100 rx routines. Also add diagnostic tracing for tx failures.
author kaf24@scramble.cl.cam.ac.uk
date Sat Apr 24 08:10:58 2004 +0000 (2004-04-24)
parents cd4da543a120
children 8c64f13373a3
files xen/drivers/net/e100/e100.h xen/drivers/net/e100/e100_main.c
line diff
     1.1 --- a/xen/drivers/net/e100/e100.h	Fri Apr 23 12:48:48 2004 +0000
     1.2 +++ b/xen/drivers/net/e100/e100.h	Sat Apr 24 08:10:58 2004 +0000
     1.3 @@ -484,7 +484,6 @@ typedef struct net_device_stats net_dev_
     1.4  #define TCBS_AVAIL(X)     (NEXT_TCB_TOUSE( NEXT_TCB_TOUSE((X).tail)) != (X).head)
     1.5  
     1.6  #define RFD_POINTER(skb,bdp)      ((rfd_t *) (((unsigned char *)((skb)->data))-((bdp)->rfd_size)))
     1.7 -#define SKB_RFD_STATUS(skb,bdp)   ((RFD_POINTER((skb),(bdp)))->rfd_header.cb_status)
     1.8  
     1.9  /* ====================================================================== */
    1.10  /*                              82557                                     */
    1.11 @@ -977,6 +976,16 @@ extern unsigned char e100_configure_devi
    1.12  extern unsigned char e100_cu_unknown_state(struct e100_private *bdp);
    1.13  #endif
    1.14  
    1.15 +static inline u16 SKB_RFD_STATUS(struct sk_buff *skb, struct e100_private *bdp)
    1.16 +{
    1.17 +    u16    status;
    1.18 +    rfd_t *rfd = RFD_POINTER(skb, bdp);
    1.19 +    rfd = map_domain_mem(__pa(rfd));
    1.20 +    status = rfd->rfd_header.cb_status;
    1.21 +    unmap_domain_mem(rfd);
    1.22 +    return status;
    1.23 +}
    1.24 +
    1.25  #define ROM_TEST_FAIL		0x01
    1.26  #define REGISTER_TEST_FAIL	0x02
    1.27  #define SELF_TEST_FAIL		0x04
     2.1 --- a/xen/drivers/net/e100/e100_main.c	Fri Apr 23 12:48:48 2004 +0000
     2.2 +++ b/xen/drivers/net/e100/e100_main.c	Sat Apr 24 08:10:58 2004 +0000
     2.3 @@ -1092,6 +1092,7 @@ e100_xmit_frame(struct sk_buff *skb, str
     2.4  	struct e100_private *bdp = dev->priv;
     2.5  
     2.6  	if (!spin_trylock(&bdp->bd_non_tx_lock)) {
     2.7 +		printk("Couldn't acqure lock in e100_xmit_frame\n");
     2.8  		notify_stop = true;
     2.9  		rc = 1;
    2.10  		goto exit2;
    2.11 @@ -1099,6 +1100,10 @@ e100_xmit_frame(struct sk_buff *skb, str
    2.12  
    2.13  	if (!TCBS_AVAIL(bdp->tcb_pool) ||
    2.14  	    (bdp->non_tx_command_state != E100_NON_TX_IDLE)) {
    2.15 +		printk("Bailing from e100_tx_frame %d, %d, %d\n",
    2.16 +			TCBS_AVAIL(bdp->tcb_pool),
    2.17 +			bdp->non_tx_command_state,
    2.18 +			E100_NON_TX_IDLE);
    2.19  		notify_stop = true;
    2.20  		rc = 1;
    2.21  		goto exit1;