Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1ca03cbc2057f61390e8e8a3234dc0bb0a8fe57a
Commit:     1ca03cbc2057f61390e8e8a3234dc0bb0a8fe57a
Parent:     606fcd0b94f7531f52a9b07008a4461213cbcd27
Author:     Divy Le Ray <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 17 11:06:36 2007 -0700
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Thu Apr 19 15:01:16 2007 -0400

    cxgb3 - PHY interrupts and GPIO pins.
    
    Remove assumption that PHY interrupts use GPIOs 3 and 5.
    Deal with PHY interrupts connected to any GPIO pins.
    
    Signed-off-by: Divy Le Ray <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/cxgb3/t3_hw.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index d83f075..fb485d0 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1523,19 +1523,25 @@ static int mac_intr_handler(struct adapter *adap, 
unsigned int idx)
  */
 int t3_phy_intr_handler(struct adapter *adapter)
 {
-       static const int intr_gpio_bits[] = { 8, 0x20 };
-
+       u32 mask, gpi = adapter_info(adapter)->gpio_intr;
        u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE);
 
        for_each_port(adapter, i) {
-               if (cause & intr_gpio_bits[i]) {
-                       struct cphy *phy = &adap2pinfo(adapter, i)->phy;
-                       int phy_cause = phy->ops->intr_handler(phy);
+               struct port_info *p = adap2pinfo(adapter, i);
+
+               mask = gpi - (gpi & (gpi - 1));
+               gpi -= mask;
+
+               if (!(p->port_type->caps & SUPPORTED_IRQ))
+                       continue;
+
+               if (cause & mask) {
+                       int phy_cause = p->phy.ops->intr_handler(&p->phy);
 
                        if (phy_cause & cphy_cause_link_change)
                                t3_link_changed(adapter, i);
                        if (phy_cause & cphy_cause_fifo_error)
-                               phy->fifo_errors++;
+                               p->phy.fifo_errors++;
                }
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to