Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

void flexcan_mbm_isr ( struct net_device *  dev  ) 

The function call by CAN ISR to handle mb events.

Parameters:
dev the pointer of network device.
Returns:
none

Definition at line 198 of file mbm.c.

{
      int i, iflag1, iflag2, maxmb;
      struct flexcan_device *flexcan = dev ? netdev_priv(dev) : NULL;

      if (flexcan->maxmb > 31) {
            maxmb = flexcan->maxmb + 1 - 32;
            iflag1 = __raw_readl(flexcan->io_base + CAN_HW_REG_IFLAG1) &
                __raw_readl(flexcan->io_base + CAN_HW_REG_IMASK1);
            iflag2 = __raw_readl(flexcan->io_base + CAN_HW_REG_IFLAG2) &
                __raw_readl(flexcan->io_base + CAN_HW_REG_IMASK2);
            iflag2 &= (1 << maxmb) - 1;
            maxmb = 32;
      } else {
            maxmb = flexcan->maxmb + 1;
            iflag1 = __raw_readl(flexcan->io_base + CAN_HW_REG_IFLAG1) &
                __raw_readl(flexcan->io_base + CAN_HW_REG_IMASK1);
            iflag1 &= (1 << maxmb) - 1;
            iflag2 = 0;
      }

      __raw_writel(iflag1, flexcan->io_base + CAN_HW_REG_IFLAG1);
      __raw_writel(iflag2, flexcan->io_base + CAN_HW_REG_IFLAG2);

      if (flexcan->fifo) {
            flexcan_fifo_isr(dev, iflag1);
            iflag1 &= 0xFFFFFF00;
      }
      for (i = 0; iflag1 && (i < maxmb); i++) {
            if (iflag1 & (1 << i)) {
                  iflag1 &= ~(1 << i);
                  flexcan_mb_bottom(dev, i);
            }
      }

      for (i = maxmb; iflag2 && (i <= flexcan->maxmb); i++) {
            if (iflag2 & (1 << (i - 32))) {
                  iflag2 &= ~(1 << (i - 32));
                  flexcan_mb_bottom(dev, i);
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index