2940#else
2941 return h->access.intr_pending(h);
2942#endif
2943}
2944
2945static inline long interrupt_not_for_us(ctlr_info_t *h)
2946{
2947#ifdef CONFIG_CISS_SCSI_TAPE
2948 return (((h->access.intr_pending(h) == 0) ||
2949 (h->interrupts_enabled == 0))
2950 && (h->scsi_rejects.ncompletions == 0));
2951#else
2952 return (((h->access.intr_pending(h) == 0) ||
2953 (h->interrupts_enabled == 0)));
2954#endif
2955}
2956
2957static irqreturn_t do_cciss_intr(int irq, void *dev_id)
2958{
2959 ctlr_info_t *h = dev_id;
2960 CommandList_struct *c;
2961 unsigned long flags;
2962 __u32 a, a1, a2;
2963
2964 if (interrupt_not_for_us(h))
2965 return IRQ_NONE;
2966
2967
2968
2969
2970 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
2971 while (interrupt_pending(h)) {
2972 while ((a = get_next_completion(h)) != FIFO_EMPTY) {
2973 a1 = a;
2974 if ((a & 0x04)) {
2975 a2 = (a >> 3);
2976 if (a2 >= h->nr_cmds) {
2977 printk(KERN_WARNING
2978 "cciss: controller cciss%d failed, stopping.\n",
2979 h->ctlr);
2980 fail_all_cmds(h->ctlr);