~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to drivers/net/smc911x.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
 */
107
107
#define POWER_DOWN               1
108
108
 
109
 
 
110
 
/* store this information for the driver.. */
111
 
struct smc911x_local {
112
 
        /*
113
 
         * If I have to wait until the DMA is finished and ready to reload a
114
 
         * packet, I will store the skbuff here. Then, the DMA will send it
115
 
         * out and free it.
116
 
         */
117
 
        struct sk_buff *pending_tx_skb;
118
 
 
119
 
        /* version/revision of the SMC911x chip */
120
 
        u16 version;
121
 
        u16 revision;
122
 
 
123
 
        /* FIFO sizes */
124
 
        int tx_fifo_kb;
125
 
        int tx_fifo_size;
126
 
        int rx_fifo_size;
127
 
        int afc_cfg;
128
 
 
129
 
        /* Contains the current active receive/phy mode */
130
 
        int ctl_rfduplx;
131
 
        int ctl_rspeed;
132
 
 
133
 
        u32 msg_enable;
134
 
        u32 phy_type;
135
 
        struct mii_if_info mii;
136
 
 
137
 
        /* work queue */
138
 
        struct work_struct phy_configure;
139
 
 
140
 
        int tx_throttle;
141
 
        spinlock_t lock;
142
 
 
143
 
        struct net_device *netdev;
144
 
 
145
 
#ifdef SMC_USE_DMA
146
 
        /* DMA needs the physical address of the chip */
147
 
        u_long physaddr;
148
 
        int rxdma;
149
 
        int txdma;
150
 
        int rxdma_active;
151
 
        int txdma_active;
152
 
        struct sk_buff *current_rx_skb;
153
 
        struct sk_buff *current_tx_skb;
154
 
        struct device *dev;
155
 
#endif
156
 
 
157
 
        /* Interrupt polarity */
158
 
        int int_polarity;
159
 
};
160
 
 
161
109
#if SMC_DEBUG > 0
162
110
#define DBG(n, args...)                          \
163
111
        do {                                     \
1968
1916
                "%s: tx_fifo %d rx_fifo %d afc_cfg 0x%08x\n", CARDNAME,
1969
1917
                lp->tx_fifo_size, lp->rx_fifo_size, lp->afc_cfg);
1970
1918
 
1971
 
        lp->int_polarity = int_polarity;
1972
 
 
1973
1919
        spin_lock_init(&lp->lock);
1974
1920
 
1975
1921
        /* Get the MAC address */
2109
2055
 */
2110
2056
static int __devinit smc911x_drv_probe(struct platform_device *pdev)
2111
2057
{
2112
 
        struct smc911x_platdata *pd = pdev->dev.platform_data;
2113
2058
        struct net_device *ndev;
2114
2059
        struct resource *res;
2115
2060
        struct smc911x_local *lp;
2116
 
        int int_polarity;
2117
2061
        unsigned int *addr;
2118
2062
        int ret;
2119
2063
 
2161
2105
                goto release_both;
2162
2106
        }
2163
2107
 
2164
 
        int_polarity = 0;
2165
 
        if (pd != NULL)
2166
 
                int_polarity = pd->int_polarity;
2167
 
 
2168
2108
        platform_set_drvdata(pdev, ndev);
2169
2109
        lp->base = addr;
2170
2110
        ndev->base_addr = res->start;