diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-25 09:52:59 +0100 | 
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-25 09:52:59 +0100 | 
| commit | d1e16c1a61d68692dba346f4a841315343b085f4 (patch) | |
| tree | 249ec07d1489769fe83b4ec507708455cc0c5138 /drivers/net/can/c_can/c_can.c | |
| parent | 1573ee81cb9ef24fa5acee6b7442e215e63ede2f (diff) | |
| parent | 6b16351acbd415e66ba16bf7d473ece1574cf0bc (diff) | |
| download | olio-linux-3.10-d1e16c1a61d68692dba346f4a841315343b085f4.tar.xz olio-linux-3.10-d1e16c1a61d68692dba346f4a841315343b085f4.zip  | |
Merge tag 'v3.5-rc4' into for-3.6
Linux 3.5-rc4 contains some bug fixes which overlap with new features.
Diffstat (limited to 'drivers/net/can/c_can/c_can.c')
| -rw-r--r-- | drivers/net/can/c_can/c_can.c | 16 | 
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 536bda072a1..8dc84d66eea 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c @@ -686,7 +686,7 @@ static int c_can_get_berr_counter(const struct net_device *dev,   *   * We iterate from priv->tx_echo to priv->tx_next and check if the   * packet has been transmitted, echo it back to the CAN framework. - * If we discover a not yet transmitted package, stop looking for more. + * If we discover a not yet transmitted packet, stop looking for more.   */  static void c_can_do_tx(struct net_device *dev)  { @@ -698,7 +698,7 @@ static void c_can_do_tx(struct net_device *dev)  	for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) {  		msg_obj_no = get_tx_echo_msg_obj(priv);  		val = c_can_read_reg32(priv, &priv->regs->txrqst1); -		if (!(val & (1 << msg_obj_no))) { +		if (!(val & (1 << (msg_obj_no - 1)))) {  			can_get_echo_skb(dev,  					msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST);  			stats->tx_bytes += priv->read_reg(priv, @@ -706,6 +706,8 @@ static void c_can_do_tx(struct net_device *dev)  					& IF_MCONT_DLC_MASK;  			stats->tx_packets++;  			c_can_inval_msg_object(dev, 0, msg_obj_no); +		} else { +			break;  		}  	} @@ -950,7 +952,7 @@ static int c_can_poll(struct napi_struct *napi, int quota)  	struct net_device *dev = napi->dev;  	struct c_can_priv *priv = netdev_priv(dev); -	irqstatus = priv->read_reg(priv, &priv->regs->interrupt); +	irqstatus = priv->irqstatus;  	if (!irqstatus)  		goto end; @@ -1028,12 +1030,11 @@ end:  static irqreturn_t c_can_isr(int irq, void *dev_id)  { -	u16 irqstatus;  	struct net_device *dev = (struct net_device *)dev_id;  	struct c_can_priv *priv = netdev_priv(dev); -	irqstatus = priv->read_reg(priv, &priv->regs->interrupt); -	if (!irqstatus) +	priv->irqstatus = priv->read_reg(priv, &priv->regs->interrupt); +	if (!priv->irqstatus)  		return IRQ_NONE;  	/* disable all interrupts and schedule the NAPI */ @@ -1063,10 +1064,11 @@ static int c_can_open(struct net_device *dev)  		goto exit_irq_fail;  	} +	napi_enable(&priv->napi); +  	/* start the c_can controller */  	c_can_start(dev); -	napi_enable(&priv->napi);  	netif_start_queue(dev);  	return 0;  |