blob: 5ad7e5a6f6313041c9955b929503b37e38c2608f [file] [log] [blame]
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -07001/*
2 * Agere Systems Inc.
3 * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
4 *
Alan Cox64f93032009-06-10 17:30:41 +01005 * Copyright © 2005 Agere Systems Inc.
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -07006 * All rights reserved.
7 * http://www.agere.com
8 *
9 *------------------------------------------------------------------------------
10 *
11 * et131x_initpci.c - Routines and data used to register the driver with the
12 * PCI (and PCI Express) subsystem, as well as basic driver
13 * init and startup.
14 *
15 *------------------------------------------------------------------------------
16 *
17 * SOFTWARE LICENSE
18 *
19 * This software is provided subject to the following terms and conditions,
20 * which you should read carefully before using the software. Using this
21 * software indicates your acceptance of these terms and conditions. If you do
22 * not agree with these terms and conditions, do not use the software.
23 *
Alan Cox64f93032009-06-10 17:30:41 +010024 * Copyright © 2005 Agere Systems Inc.
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070025 * All rights reserved.
26 *
27 * Redistribution and use in source or binary forms, with or without
28 * modifications, are permitted provided that the following conditions are met:
29 *
30 * . Redistributions of source code must retain the above copyright notice, this
31 * list of conditions and the following Disclaimer as comments in the code as
32 * well as in the documentation and/or other materials provided with the
33 * distribution.
34 *
35 * . Redistributions in binary form must reproduce the above copyright notice,
36 * this list of conditions and the following Disclaimer in the documentation
37 * and/or other materials provided with the distribution.
38 *
39 * . Neither the name of Agere Systems Inc. nor the names of the contributors
40 * may be used to endorse or promote products derived from this software
41 * without specific prior written permission.
42 *
43 * Disclaimer
44 *
Alan Cox64f93032009-06-10 17:30:41 +010045 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070046 * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
47 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
48 * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
49 * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
50 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
51 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
52 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
53 * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
54 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
55 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
56 * DAMAGE.
57 *
58 */
59
60#include "et131x_version.h"
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070061#include "et131x_defs.h"
62
63#include <linux/pci.h>
64#include <linux/init.h>
65#include <linux/module.h>
66#include <linux/types.h>
67#include <linux/kernel.h>
68
69#include <linux/sched.h>
70#include <linux/ptrace.h>
71#include <linux/slab.h>
72#include <linux/ctype.h>
73#include <linux/string.h>
74#include <linux/timer.h>
75#include <linux/interrupt.h>
76#include <linux/in.h>
77#include <linux/delay.h>
Alan Cox64f93032009-06-10 17:30:41 +010078#include <linux/io.h>
79#include <linux/bitops.h>
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070080#include <asm/system.h>
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070081
82#include <linux/netdevice.h>
83#include <linux/etherdevice.h>
84#include <linux/skbuff.h>
85#include <linux/if_arp.h>
86#include <linux/ioport.h>
87#include <linux/random.h>
88
89#include "et1310_phy.h"
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070090
91#include "et131x_adapter.h"
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070092
93#include "et1310_address_map.h"
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070094#include "et1310_tx.h"
95#include "et1310_rx.h"
Alan Cox69ea5fc2010-01-18 15:34:24 +000096#include "et131x.h"
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -070097
Alan Cox69ea5fc2010-01-18 15:34:24 +000098#define INTERNAL_MEM_SIZE 0x400 /* 1024 of internal memory */
99#define INTERNAL_MEM_RX_OFFSET 0x1FF /* 50% Tx, 50% Rx */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700100
Alan Cox8c5f20f2009-08-27 11:00:24 +0100101/* Defines for Parameter Default/Min/Max vaules */
102#define PARM_SPEED_DUPLEX_MIN 0
103#define PARM_SPEED_DUPLEX_MAX 5
104
Alan Cox8c5f20f2009-08-27 11:00:24 +0100105/* Module parameter for manual speed setting
106 * Set Link speed and dublex manually (0-5) [0]
107 * 1 : 10Mb Half-Duplex
108 * 2 : 10Mb Full-Duplex
109 * 3 : 100Mb Half-Duplex
110 * 4 : 100Mb Full-Duplex
111 * 5 : 1000Mb Full-Duplex
112 * 0 : Auto Speed Auto Duplex // default
113 */
114static u32 et131x_speed_set;
115module_param(et131x_speed_set, uint, 0);
116MODULE_PARM_DESC(et131x_speed_set,
117 "Set Link speed and dublex manually (0-5) [0] \n 1 : 10Mb Half-Duplex \n 2 : 10Mb Full-Duplex \n 3 : 100Mb Half-Duplex \n 4 : 100Mb Full-Duplex \n 5 : 1000Mb Full-Duplex \n 0 : Auto Speed Auto Dublex");
118
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700119/**
Alan Coxc431e3c2009-10-06 15:47:41 +0100120 * et131x_hwaddr_init - set up the MAC Address on the ET1310
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700121 * @adapter: pointer to our private adapter structure
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700122 */
Alan Coxc431e3c2009-10-06 15:47:41 +0100123void et131x_hwaddr_init(struct et131x_adapter *adapter)
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700124{
Alan Coxc431e3c2009-10-06 15:47:41 +0100125 /* If have our default mac from init and no mac address from
126 * EEPROM then we need to generate the last octet and set it on the
127 * device
128 */
129 if (adapter->PermanentAddress[0] == 0x00 &&
130 adapter->PermanentAddress[1] == 0x00 &&
131 adapter->PermanentAddress[2] == 0x00 &&
132 adapter->PermanentAddress[3] == 0x00 &&
133 adapter->PermanentAddress[4] == 0x00 &&
134 adapter->PermanentAddress[5] == 0x00) {
135 /*
136 * We need to randomly generate the last octet so we
137 * decrease our chances of setting the mac address to
138 * same as another one of our cards in the system
139 */
140 get_random_bytes(&adapter->CurrentAddress[5], 1);
141 /*
142 * We have the default value in the register we are
143 * working with so we need to copy the current
144 * address into the permanent address
145 */
146 memcpy(adapter->PermanentAddress,
147 adapter->CurrentAddress, ETH_ALEN);
148 } else {
149 /* We do not have an override address, so set the
150 * current address to the permanent address and add
151 * it to the device
152 */
153 memcpy(adapter->CurrentAddress,
154 adapter->PermanentAddress, ETH_ALEN);
155 }
156}
157
158
159/**
160 * et131x_pci_init - initial PCI setup
161 * @adapter: pointer to our private adapter structure
162 * @pdev: our PCI device
163 *
164 * Perform the initial setup of PCI registers and if possible initialise
165 * the MAC address. At this point the I/O registers have yet to be mapped
166 */
167
168static int et131x_pci_init(struct et131x_adapter *adapter,
169 struct pci_dev *pdev)
170{
171 int i;
172 u8 max_payload;
173 u8 read_size_reg;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700174
Alan Cox4e02b4b2009-10-06 15:47:22 +0100175 if (et131x_init_eeprom(adapter) < 0)
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700176 return -EIO;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700177
178 /* Let's set up the PORT LOGIC Register. First we need to know what
179 * the max_payload_size is
180 */
Alan Coxc431e3c2009-10-06 15:47:41 +0100181 if (pci_read_config_byte(pdev, ET1310_PCI_MAX_PYLD, &max_payload)) {
Alan Cox15700032009-08-27 11:03:09 +0100182 dev_err(&pdev->dev,
183 "Could not read PCI config space for Max Payload Size\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700184 return -EIO;
185 }
186
187 /* Program the Ack/Nak latency and replay timers */
Alan Coxc431e3c2009-10-06 15:47:41 +0100188 max_payload &= 0x07; /* Only the lower 3 bits are valid */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700189
Alan Coxc431e3c2009-10-06 15:47:41 +0100190 if (max_payload < 2) {
191 static const u16 AckNak[2] = { 0x76, 0xD0 };
192 static const u16 Replay[2] = { 0x1E0, 0x2ED };
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700193
Alan Coxc431e3c2009-10-06 15:47:41 +0100194 if (pci_write_config_word(pdev, ET1310_PCI_ACK_NACK,
195 AckNak[max_payload])) {
Alan Cox15700032009-08-27 11:03:09 +0100196 dev_err(&pdev->dev,
197 "Could not write PCI config space for ACK/NAK\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700198 return -EIO;
199 }
Alan Coxc431e3c2009-10-06 15:47:41 +0100200 if (pci_write_config_word(pdev, ET1310_PCI_REPLAY,
201 Replay[max_payload])) {
Alan Cox15700032009-08-27 11:03:09 +0100202 dev_err(&pdev->dev,
203 "Could not write PCI config space for Replay Timer\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700204 return -EIO;
205 }
206 }
207
208 /* l0s and l1 latency timers. We are using default values.
209 * Representing 001 for L0s and 010 for L1
210 */
Alan Coxc431e3c2009-10-06 15:47:41 +0100211 if (pci_write_config_byte(pdev, ET1310_PCI_L0L1LATENCY, 0x11)) {
Alan Cox15700032009-08-27 11:03:09 +0100212 dev_err(&pdev->dev,
213 "Could not write PCI config space for Latency Timers\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700214 return -EIO;
215 }
216
217 /* Change the max read size to 2k */
Alan Coxc431e3c2009-10-06 15:47:41 +0100218 if (pci_read_config_byte(pdev, 0x51, &read_size_reg)) {
Alan Cox15700032009-08-27 11:03:09 +0100219 dev_err(&pdev->dev,
Alan Cox64f93032009-06-10 17:30:41 +0100220 "Could not read PCI config space for Max read size\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700221 return -EIO;
222 }
223
224 read_size_reg &= 0x8f;
225 read_size_reg |= 0x40;
226
Alan Coxc431e3c2009-10-06 15:47:41 +0100227 if (pci_write_config_byte(pdev, 0x51, read_size_reg)) {
Alan Cox15700032009-08-27 11:03:09 +0100228 dev_err(&pdev->dev,
Alan Cox64f93032009-06-10 17:30:41 +0100229 "Could not write PCI config space for Max read size\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700230 return -EIO;
231 }
232
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700233 /* Get MAC address from config space if an eeprom exists, otherwise
234 * the MAC address there will not be valid
235 */
Alan Coxc431e3c2009-10-06 15:47:41 +0100236 if (!adapter->has_eeprom) {
237 et131x_hwaddr_init(adapter);
238 return 0;
239 }
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700240
Alan Coxc431e3c2009-10-06 15:47:41 +0100241 for (i = 0; i < ETH_ALEN; i++) {
242 if (pci_read_config_byte(pdev, ET1310_PCI_MAC_ADDRESS + i,
243 adapter->PermanentAddress + i)) {
244 dev_err(&pdev->dev, "Could not read PCI config space for MAC address\n");
245 return -EIO;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700246 }
247 }
Alan Coxc431e3c2009-10-06 15:47:41 +0100248 memcpy(adapter->CurrentAddress, adapter->PermanentAddress, ETH_ALEN);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700249 return 0;
250}
251
252/**
253 * et131x_error_timer_handler
254 * @data: timer-specific variable; here a pointer to our adapter structure
255 *
256 * The routine called when the error timer expires, to track the number of
257 * recurring errors.
258 */
259void et131x_error_timer_handler(unsigned long data)
260{
Alan Cox25ad00b2009-08-19 18:21:44 +0100261 struct et131x_adapter *etdev = (struct et131x_adapter *) data;
Alan Coxf2c98d22009-08-27 11:01:49 +0100262 u32 pm_csr;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700263
Alan Coxf2c98d22009-08-27 11:01:49 +0100264 pm_csr = readl(&etdev->regs->global.pm_csr);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700265
Alan Coxf2c98d22009-08-27 11:01:49 +0100266 if ((pm_csr & ET_PM_PHY_SW_COMA) == 0)
Alan Cox94831462009-08-27 11:00:06 +0100267 UpdateMacStatHostCounters(etdev);
268 else
Alan Cox15700032009-08-27 11:03:09 +0100269 dev_err(&etdev->pdev->dev,
270 "No interrupts, in PHY coma, pm_csr = 0x%x\n", pm_csr);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700271
Alan Cox25ad00b2009-08-19 18:21:44 +0100272 if (!etdev->Bmsr.bits.link_status &&
273 etdev->RegistryPhyComa &&
274 etdev->PoMgmt.TransPhyComaModeOnBoot < 11) {
275 etdev->PoMgmt.TransPhyComaModeOnBoot++;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700276 }
277
Alan Cox25ad00b2009-08-19 18:21:44 +0100278 if (etdev->PoMgmt.TransPhyComaModeOnBoot == 10) {
279 if (!etdev->Bmsr.bits.link_status
280 && etdev->RegistryPhyComa) {
Alan Coxf2c98d22009-08-27 11:01:49 +0100281 if ((pm_csr & ET_PM_PHY_SW_COMA) == 0) {
Alan Cox64f93032009-06-10 17:30:41 +0100282 /* NOTE - This was originally a 'sync with
283 * interrupt'. How to do that under Linux?
284 */
Alan Cox25ad00b2009-08-19 18:21:44 +0100285 et131x_enable_interrupts(etdev);
286 EnablePhyComa(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700287 }
288 }
289 }
290
291 /* This is a periodic timer, so reschedule */
Alan Cox25ad00b2009-08-19 18:21:44 +0100292 mod_timer(&etdev->ErrorTimer, jiffies +
Alan Cox64f93032009-06-10 17:30:41 +0100293 TX_ERROR_PERIOD * HZ / 1000);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700294}
295
296/**
297 * et131x_link_detection_handler
298 *
299 * Timer function for link up at driver load time
300 */
301void et131x_link_detection_handler(unsigned long data)
302{
Alan Cox25ad00b2009-08-19 18:21:44 +0100303 struct et131x_adapter *etdev = (struct et131x_adapter *) data;
Alan Cox37628602009-08-19 18:21:50 +0100304 unsigned long flags;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700305
Alan Cox25ad00b2009-08-19 18:21:44 +0100306 if (etdev->MediaState == 0) {
Alan Cox37628602009-08-19 18:21:50 +0100307 spin_lock_irqsave(&etdev->Lock, flags);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700308
Alan Cox25ad00b2009-08-19 18:21:44 +0100309 etdev->MediaState = NETIF_STATUS_MEDIA_DISCONNECT;
Alan Coxf6b35d62009-08-27 11:02:05 +0100310 etdev->Flags &= ~fMP_ADAPTER_LINK_DETECTION;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700311
Alan Cox37628602009-08-19 18:21:50 +0100312 spin_unlock_irqrestore(&etdev->Lock, flags);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700313
Alan Cox25ad00b2009-08-19 18:21:44 +0100314 netif_carrier_off(etdev->netdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700315 }
316}
317
318/**
Alan Coxb8c4cc42009-08-27 11:02:25 +0100319 * et131x_configure_global_regs - configure JAGCore global regs
320 * @etdev: pointer to our adapter structure
321 *
322 * Used to configure the global registers on the JAGCore
323 */
324void ConfigGlobalRegs(struct et131x_adapter *etdev)
325{
Alan Cox2b903322010-01-18 15:33:12 +0000326 struct global_regs __iomem *regs = &etdev->regs->global;
Alan Coxb8c4cc42009-08-27 11:02:25 +0100327
Alan Cox5f1377d2009-10-06 15:47:55 +0100328 writel(0, &regs->rxq_start_addr);
329 writel(INTERNAL_MEM_SIZE - 1, &regs->txq_end_addr);
Alan Coxb8c4cc42009-08-27 11:02:25 +0100330
Alan Cox5f1377d2009-10-06 15:47:55 +0100331 if (etdev->RegistryJumboPacket < 2048) {
332 /* Tx / RxDMA and Tx/Rx MAC interfaces have a 1k word
333 * block of RAM that the driver can split between Tx
334 * and Rx as it desires. Our default is to split it
335 * 50/50:
Alan Coxb8c4cc42009-08-27 11:02:25 +0100336 */
Alan Cox5f1377d2009-10-06 15:47:55 +0100337 writel(PARM_RX_MEM_END_DEF, &regs->rxq_end_addr);
338 writel(PARM_RX_MEM_END_DEF + 1, &regs->txq_start_addr);
339 } else if (etdev->RegistryJumboPacket < 8192) {
340 /* For jumbo packets > 2k but < 8k, split 50-50. */
341 writel(INTERNAL_MEM_RX_OFFSET, &regs->rxq_end_addr);
342 writel(INTERNAL_MEM_RX_OFFSET + 1, &regs->txq_start_addr);
343 } else {
344 /* 9216 is the only packet size greater than 8k that
345 * is available. The Tx buffer has to be big enough
346 * for one whole packet on the Tx side. We'll make
347 * the Tx 9408, and give the rest to Rx
348 */
349 writel(0x01b3, &regs->rxq_end_addr);
350 writel(0x01b4, &regs->txq_start_addr);
Alan Coxb8c4cc42009-08-27 11:02:25 +0100351 }
352
Alan Cox5f1377d2009-10-06 15:47:55 +0100353 /* Initialize the loopback register. Disable all loopbacks. */
354 writel(0, &regs->loopback);
355
Alan Coxb8c4cc42009-08-27 11:02:25 +0100356 /* MSI Register */
Alan Coxe266b202009-08-27 11:02:34 +0100357 writel(0, &regs->msi_config);
Alan Coxb8c4cc42009-08-27 11:02:25 +0100358
359 /* By default, disable the watchdog timer. It will be enabled when
360 * a packet is queued.
361 */
Alan Coxe266b202009-08-27 11:02:34 +0100362 writel(0, &regs->watchdog_timer);
Alan Coxb8c4cc42009-08-27 11:02:25 +0100363}
364
365
366/**
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700367 * et131x_adapter_setup - Set the adapter up as per cassini+ documentation
368 * @adapter: pointer to our private adapter structure
369 *
370 * Returns 0 on success, errno on failure (as defined in errno.h)
371 */
Alan Cox25ad00b2009-08-19 18:21:44 +0100372int et131x_adapter_setup(struct et131x_adapter *etdev)
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700373{
374 int status = 0;
375
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700376 /* Configure the JAGCore */
Alan Cox25ad00b2009-08-19 18:21:44 +0100377 ConfigGlobalRegs(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700378
Alan Cox25ad00b2009-08-19 18:21:44 +0100379 ConfigMACRegs1(etdev);
Alan Coxb8c4cc42009-08-27 11:02:25 +0100380
381 /* Configure the MMC registers */
382 /* All we need to do is initialize the Memory Control Register */
383 writel(ET_MMC_ENABLE, &etdev->regs->mmc.mmc_ctrl);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700384
Alan Cox25ad00b2009-08-19 18:21:44 +0100385 ConfigRxMacRegs(etdev);
386 ConfigTxMacRegs(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700387
Alan Cox25ad00b2009-08-19 18:21:44 +0100388 ConfigRxDmaRegs(etdev);
389 ConfigTxDmaRegs(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700390
Alan Cox25ad00b2009-08-19 18:21:44 +0100391 ConfigMacStatRegs(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700392
393 /* Move the following code to Timer function?? */
Alan Cox25ad00b2009-08-19 18:21:44 +0100394 status = et131x_xcvr_find(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700395
Alan Cox64f93032009-06-10 17:30:41 +0100396 if (status != 0)
Alan Cox15700032009-08-27 11:03:09 +0100397 dev_warn(&etdev->pdev->dev, "Could not find the xcvr\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700398
399 /* Prepare the TRUEPHY library. */
Alan Cox25ad00b2009-08-19 18:21:44 +0100400 ET1310_PhyInit(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700401
402 /* Reset the phy now so changes take place */
Alan Cox25ad00b2009-08-19 18:21:44 +0100403 ET1310_PhyReset(etdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700404
405 /* Power down PHY */
Alan Cox25ad00b2009-08-19 18:21:44 +0100406 ET1310_PhyPowerDown(etdev, 1);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700407
408 /*
409 * We need to turn off 1000 base half dulplex, the mac does not
410 * support it. For the 10/100 part, turn off all gig advertisement
411 */
Alan Cox5ec34872009-08-27 10:59:13 +0100412 if (etdev->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
Alan Cox25ad00b2009-08-19 18:21:44 +0100413 ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
Alan Cox64f93032009-06-10 17:30:41 +0100414 else
Alan Cox25ad00b2009-08-19 18:21:44 +0100415 ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700416
417 /* Power up PHY */
Alan Cox25ad00b2009-08-19 18:21:44 +0100418 ET1310_PhyPowerDown(etdev, 0);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700419
Alan Cox25ad00b2009-08-19 18:21:44 +0100420 et131x_setphy_normal(etdev);
Alan Cox15700032009-08-27 11:03:09 +0100421; return status;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700422}
423
424/**
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700425 * et131x_soft_reset - Issue a soft reset to the hardware, complete for ET1310
426 * @adapter: pointer to our private adapter structure
427 */
428void et131x_soft_reset(struct et131x_adapter *adapter)
429{
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700430 /* Disable MAC Core */
Alan Coxc9835d972009-10-06 15:50:45 +0100431 writel(0xc00f0000, &adapter->regs->mac.cfg1);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700432
433 /* Set everything to a reset value */
Alan Coxb8c4cc42009-08-27 11:02:25 +0100434 writel(0x7F, &adapter->regs->global.sw_reset);
Alan Coxc9835d972009-10-06 15:50:45 +0100435 writel(0x000f0000, &adapter->regs->mac.cfg1);
436 writel(0x00000000, &adapter->regs->mac.cfg1);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700437}
438
439/**
440 * et131x_align_allocated_memory - Align allocated memory on a given boundary
441 * @adapter: pointer to our adapter structure
442 * @phys_addr: pointer to Physical address
443 * @offset: pointer to the offset variable
444 * @mask: correct mask
445 */
446void et131x_align_allocated_memory(struct et131x_adapter *adapter,
447 uint64_t *phys_addr,
448 uint64_t *offset, uint64_t mask)
449{
450 uint64_t new_addr;
451
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700452 *offset = 0;
453
454 new_addr = *phys_addr & ~mask;
455
456 if (new_addr != *phys_addr) {
457 /* Move to next aligned block */
458 new_addr += mask + 1;
459 /* Return offset for adjusting virt addr */
460 *offset = new_addr - *phys_addr;
461 /* Return new physical address */
462 *phys_addr = new_addr;
463 }
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700464}
465
466/**
467 * et131x_adapter_memory_alloc
468 * @adapter: pointer to our private adapter structure
469 *
470 * Returns 0 on success, errno on failure (as defined in errno.h).
471 *
472 * Allocate all the memory blocks for send, receive and others.
473 */
474int et131x_adapter_memory_alloc(struct et131x_adapter *adapter)
475{
Alan Coxc431e3c2009-10-06 15:47:41 +0100476 int status;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700477
Alan Coxc431e3c2009-10-06 15:47:41 +0100478 /* Allocate memory for the Tx Ring */
479 status = et131x_tx_dma_memory_alloc(adapter);
480 if (status != 0) {
481 dev_err(&adapter->pdev->dev,
482 "et131x_tx_dma_memory_alloc FAILED\n");
483 return status;
484 }
485 /* Receive buffer memory allocation */
486 status = et131x_rx_dma_memory_alloc(adapter);
487 if (status != 0) {
488 dev_err(&adapter->pdev->dev,
489 "et131x_rx_dma_memory_alloc FAILED\n");
490 et131x_tx_dma_memory_free(adapter);
491 return status;
492 }
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700493
Alan Coxc431e3c2009-10-06 15:47:41 +0100494 /* Init receive data structures */
495 status = et131x_init_recv(adapter);
496 if (status != 0) {
497 dev_err(&adapter->pdev->dev,
498 "et131x_init_recv FAILED\n");
499 et131x_tx_dma_memory_free(adapter);
500 et131x_rx_dma_memory_free(adapter);
501 }
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700502 return status;
503}
504
505/**
506 * et131x_adapter_memory_free - Free all memory allocated for use by Tx & Rx
507 * @adapter: pointer to our private adapter structure
508 */
509void et131x_adapter_memory_free(struct et131x_adapter *adapter)
510{
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700511 /* Free DMA memory */
512 et131x_tx_dma_memory_free(adapter);
513 et131x_rx_dma_memory_free(adapter);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700514}
515
Alan Coxc431e3c2009-10-06 15:47:41 +0100516
517
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700518/**
Alan Coxc431e3c2009-10-06 15:47:41 +0100519 * et131x_adapter_init
Alan Cox8c5f20f2009-08-27 11:00:24 +0100520 * @etdev: pointer to the private adapter struct
Alan Coxc431e3c2009-10-06 15:47:41 +0100521 * @pdev: pointer to the PCI device
Alan Cox8c5f20f2009-08-27 11:00:24 +0100522 *
Alan Coxc431e3c2009-10-06 15:47:41 +0100523 * Initialize the data structures for the et131x_adapter object and link
524 * them together with the platform provided device structures.
Alan Cox8c5f20f2009-08-27 11:00:24 +0100525 */
Alan Coxc431e3c2009-10-06 15:47:41 +0100526
527
528static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
529 struct pci_dev *pdev)
Alan Cox8c5f20f2009-08-27 11:00:24 +0100530{
531 static const u8 default_mac[] = { 0x00, 0x05, 0x3d, 0x00, 0x02, 0x00 };
532 static const u8 duplex[] = { 0, 1, 2, 1, 2, 2 };
533 static const u16 speed[] = { 0, 10, 10, 100, 100, 1000 };
534
Alan Coxc431e3c2009-10-06 15:47:41 +0100535 struct et131x_adapter *etdev;
536
537 /* Setup the fundamental net_device and private adapter structure elements */
538 SET_NETDEV_DEV(netdev, &pdev->dev);
539
540 /* Allocate private adapter struct and copy in relevant information */
541 etdev = netdev_priv(netdev);
542 etdev->pdev = pci_dev_get(pdev);
543 etdev->netdev = netdev;
544
545 /* Do the same for the netdev struct */
546 netdev->irq = pdev->irq;
547 netdev->base_addr = pci_resource_start(pdev, 0);
548
549 /* Initialize spinlocks here */
550 spin_lock_init(&etdev->Lock);
551 spin_lock_init(&etdev->TCBSendQLock);
552 spin_lock_init(&etdev->TCBReadyQLock);
553 spin_lock_init(&etdev->SendHWLock);
Alan Coxc431e3c2009-10-06 15:47:41 +0100554 spin_lock_init(&etdev->RcvLock);
555 spin_lock_init(&etdev->RcvPendLock);
556 spin_lock_init(&etdev->FbrLock);
557 spin_lock_init(&etdev->PHYLock);
558
559 /* Parse configuration parameters into the private adapter struct */
Alan Cox8c5f20f2009-08-27 11:00:24 +0100560 if (et131x_speed_set)
Alan Cox15700032009-08-27 11:03:09 +0100561 dev_info(&etdev->pdev->dev,
562 "Speed set manually to : %d \n", et131x_speed_set);
Alan Cox8c5f20f2009-08-27 11:00:24 +0100563
564 etdev->SpeedDuplex = et131x_speed_set;
565 etdev->RegistryJumboPacket = 1514; /* 1514-9216 */
566
Alan Cox8c5f20f2009-08-27 11:00:24 +0100567 /* Set the MAC address to a default */
568 memcpy(etdev->CurrentAddress, default_mac, ETH_ALEN);
569
570 /* Decode SpeedDuplex
571 *
572 * Set up as if we are auto negotiating always and then change if we
573 * go into force mode
574 *
575 * If we are the 10/100 device, and gigabit is somehow requested then
576 * knock it down to 100 full.
577 */
578 if (etdev->pdev->device == ET131X_PCI_DEVICE_ID_FAST &&
579 etdev->SpeedDuplex == 5)
580 etdev->SpeedDuplex = 4;
581
582 etdev->AiForceSpeed = speed[etdev->SpeedDuplex];
583 etdev->AiForceDpx = duplex[etdev->SpeedDuplex]; /* Auto FDX */
Alan Coxc431e3c2009-10-06 15:47:41 +0100584
585 return etdev;
Alan Cox8c5f20f2009-08-27 11:00:24 +0100586}
587
Alan Cox7ca5d422009-08-27 11:03:21 +0100588/**
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700589 * et131x_pci_setup - Perform device initialization
590 * @pdev: a pointer to the device's pci_dev structure
591 * @ent: this device's entry in the pci_device_id table
592 *
593 * Returns 0 on success, errno on failure (as defined in errno.h)
594 *
595 * Registered in the pci_driver structure, this function is called when the
596 * PCI subsystem finds a new PCI device which matches the information
597 * contained in the pci_device_id table. This routine is the equivalent to
598 * a device insertion routine.
599 */
Alan Cox7ca5d422009-08-27 11:03:21 +0100600
Alan Coxc431e3c2009-10-06 15:47:41 +0100601static int __devinit et131x_pci_setup(struct pci_dev *pdev,
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700602 const struct pci_device_id *ent)
603{
Alan Coxc431e3c2009-10-06 15:47:41 +0100604 int result = -EBUSY;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700605 int pm_cap;
606 bool pci_using_dac;
Alan Coxc431e3c2009-10-06 15:47:41 +0100607 struct net_device *netdev;
608 struct et131x_adapter *adapter;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700609
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700610 /* Enable the device via the PCI subsystem */
Alan Coxc431e3c2009-10-06 15:47:41 +0100611 if (pci_enable_device(pdev) != 0) {
612 dev_err(&pdev->dev,
Alan Cox15700032009-08-27 11:03:09 +0100613 "pci_enable_device() failed\n");
Alan Coxc431e3c2009-10-06 15:47:41 +0100614 return -EIO;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700615 }
616
617 /* Perform some basic PCI checks */
618 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
Alan Coxc431e3c2009-10-06 15:47:41 +0100619 dev_err(&pdev->dev,
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700620 "Can't find PCI device's base address\n");
Alan Coxc431e3c2009-10-06 15:47:41 +0100621 goto err_disable;
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700622 }
623
Alan Coxc431e3c2009-10-06 15:47:41 +0100624 if (pci_request_regions(pdev, DRIVER_NAME)) {
625 dev_err(&pdev->dev,
Alan Cox15700032009-08-27 11:03:09 +0100626 "Can't get PCI resources\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700627 goto err_disable;
628 }
629
630 /* Enable PCI bus mastering */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700631 pci_set_master(pdev);
632
633 /* Query PCI for Power Mgmt Capabilities
634 *
635 * NOTE: Now reading PowerMgmt in another location; is this still
636 * needed?
637 */
638 pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
639 if (pm_cap == 0) {
Alan Coxc431e3c2009-10-06 15:47:41 +0100640 dev_err(&pdev->dev,
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700641 "Cannot find Power Management capabilities\n");
642 result = -EIO;
643 goto err_release_res;
644 }
645
646 /* Check the DMA addressing support of this device */
Alan Coxc431e3c2009-10-06 15:47:41 +0100647 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700648 pci_using_dac = true;
649
Alan Coxc431e3c2009-10-06 15:47:41 +0100650 result = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700651 if (result != 0) {
Alan Cox15700032009-08-27 11:03:09 +0100652 dev_err(&pdev->dev,
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700653 "Unable to obtain 64 bit DMA for consistent allocations\n");
654 goto err_release_res;
655 }
Alan Coxc431e3c2009-10-06 15:47:41 +0100656 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700657 pci_using_dac = false;
658 } else {
Alan Coxc431e3c2009-10-06 15:47:41 +0100659 dev_err(&pdev->dev,
Alan Cox15700032009-08-27 11:03:09 +0100660 "No usable DMA addressing method\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700661 result = -EIO;
662 goto err_release_res;
663 }
664
665 /* Allocate netdev and private adapter structs */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700666 netdev = et131x_device_alloc();
667 if (netdev == NULL) {
Alan Coxc431e3c2009-10-06 15:47:41 +0100668 dev_err(&pdev->dev, "Couldn't alloc netdev struct\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700669 result = -ENOMEM;
670 goto err_release_res;
671 }
Alan Coxc431e3c2009-10-06 15:47:41 +0100672 adapter = et131x_adapter_init(netdev, pdev);
673 /* Initialise the PCI setup for the device */
674 et131x_pci_init(adapter, pdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700675
676 /* Map the bus-relative registers to system virtual memory */
Alan Coxc431e3c2009-10-06 15:47:41 +0100677 adapter->regs = pci_ioremap_bar(pdev, 0);
Alan Coxf3f415a2009-08-27 10:59:30 +0100678 if (adapter->regs == NULL) {
Alan Cox15700032009-08-27 11:03:09 +0100679 dev_err(&pdev->dev, "Cannot map device registers\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700680 result = -ENOMEM;
681 goto err_free_dev;
682 }
683
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700684 /* If Phy COMA mode was enabled when we went down, disable it here. */
Alan Coxf2c98d22009-08-27 11:01:49 +0100685 writel(ET_PMCSR_INIT, &adapter->regs->global.pm_csr);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700686
687 /* Issue a global reset to the et1310 */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700688 et131x_soft_reset(adapter);
689
690 /* Disable all interrupts (paranoid) */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700691 et131x_disable_interrupts(adapter);
692
693 /* Allocate DMA memory */
694 result = et131x_adapter_memory_alloc(adapter);
695 if (result != 0) {
Alan Cox15700032009-08-27 11:03:09 +0100696 dev_err(&pdev->dev, "Could not alloc adapater memory (DMA)\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700697 goto err_iounmap;
698 }
699
700 /* Init send data structures */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700701 et131x_init_send(adapter);
702
Alan Coxc431e3c2009-10-06 15:47:41 +0100703 /*
704 * Set up the task structure for the ISR's deferred handler
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700705 */
706 INIT_WORK(&adapter->task, et131x_isr_handler);
707
Alan Coxc431e3c2009-10-06 15:47:41 +0100708 /* Copy address into the net_device struct */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700709 memcpy(netdev->dev_addr, adapter->CurrentAddress, ETH_ALEN);
710
711 /* Setup et1310 as per the documentation */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700712 et131x_adapter_setup(adapter);
713
714 /* Create a timer to count errors received by the NIC */
715 init_timer(&adapter->ErrorTimer);
716
717 adapter->ErrorTimer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000;
718 adapter->ErrorTimer.function = et131x_error_timer_handler;
719 adapter->ErrorTimer.data = (unsigned long)adapter;
720
721 /* Initialize link state */
722 et131x_link_detection_handler((unsigned long)adapter);
723
Alan Cox64f93032009-06-10 17:30:41 +0100724 /* Intialize variable for counting how long we do not have
725 link status */
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700726 adapter->PoMgmt.TransPhyComaModeOnBoot = 0;
727
728 /* We can enable interrupts now
729 *
730 * NOTE - Because registration of interrupt handler is done in the
731 * device's open(), defer enabling device interrupts to that
732 * point
733 */
734
735 /* Register the net_device struct with the Linux network layer */
Alan Cox64f93032009-06-10 17:30:41 +0100736 result = register_netdev(netdev);
737 if (result != 0) {
Alan Cox15700032009-08-27 11:03:09 +0100738 dev_err(&pdev->dev, "register_netdev() failed\n");
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700739 goto err_mem_free;
740 }
741
742 /* Register the net_device struct with the PCI subsystem. Save a copy
743 * of the PCI config space for this device now that the device has
744 * been initialized, just in case it needs to be quickly restored.
745 */
746 pci_set_drvdata(pdev, netdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700747 pci_save_state(adapter->pdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700748 return result;
749
750err_mem_free:
751 et131x_adapter_memory_free(adapter);
752err_iounmap:
Alan Coxf3f415a2009-08-27 10:59:30 +0100753 iounmap(adapter->regs);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700754err_free_dev:
Alan Cox6ae56042009-08-27 10:59:21 +0100755 pci_dev_put(pdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700756 free_netdev(netdev);
757err_release_res:
758 pci_release_regions(pdev);
759err_disable:
760 pci_disable_device(pdev);
Alan Coxc431e3c2009-10-06 15:47:41 +0100761 return result;
762}
763
764/**
765 * et131x_pci_remove
766 * @pdev: a pointer to the device's pci_dev structure
767 *
768 * Registered in the pci_driver structure, this function is called when the
769 * PCI subsystem detects that a PCI device which matches the information
770 * contained in the pci_device_id table has been removed.
771 */
772
773static void __devexit et131x_pci_remove(struct pci_dev *pdev)
774{
775 struct net_device *netdev;
776 struct et131x_adapter *adapter;
777
778 /* Retrieve the net_device pointer from the pci_dev struct, as well
779 * as the private adapter struct
780 */
781 netdev = (struct net_device *) pci_get_drvdata(pdev);
782 adapter = netdev_priv(netdev);
783
784 /* Perform device cleanup */
785 unregister_netdev(netdev);
786 et131x_adapter_memory_free(adapter);
787 iounmap(adapter->regs);
788 pci_dev_put(adapter->pdev);
789 free_netdev(netdev);
790 pci_release_regions(pdev);
791 pci_disable_device(pdev);
Greg Kroah-Hartmancfb739b2008-04-03 17:30:53 -0700792}
Alan Cox7ca5d422009-08-27 11:03:21 +0100793
794static struct pci_device_id et131x_pci_table[] __devinitdata = {
795 {ET131X_PCI_VENDOR_ID, ET131X_PCI_DEVICE_ID_GIG, PCI_ANY_ID,
796 PCI_ANY_ID, 0, 0, 0UL},
797 {ET131X_PCI_VENDOR_ID, ET131X_PCI_DEVICE_ID_FAST, PCI_ANY_ID,
798 PCI_ANY_ID, 0, 0, 0UL},
799 {0,}
800};
801
802MODULE_DEVICE_TABLE(pci, et131x_pci_table);
803
804static struct pci_driver et131x_driver = {
805 .name = DRIVER_NAME,
806 .id_table = et131x_pci_table,
807 .probe = et131x_pci_setup,
808 .remove = __devexit_p(et131x_pci_remove),
809 .suspend = NULL, /* et131x_pci_suspend */
810 .resume = NULL, /* et131x_pci_resume */
811};
812
813
814/**
815 * et131x_init_module - The "main" entry point called on driver initialization
816 *
817 * Returns 0 on success, errno on failure (as defined in errno.h)
818 */
Peter Huewe3c0d4462009-09-29 01:34:14 +0200819static int __init et131x_init_module(void)
Alan Cox7ca5d422009-08-27 11:03:21 +0100820{
821 if (et131x_speed_set < PARM_SPEED_DUPLEX_MIN ||
822 et131x_speed_set > PARM_SPEED_DUPLEX_MAX) {
823 printk(KERN_WARNING "et131x: invalid speed setting ignored.\n");
824 et131x_speed_set = 0;
825 }
826 return pci_register_driver(&et131x_driver);
827}
828
829/**
830 * et131x_cleanup_module - The entry point called on driver cleanup
831 */
Peter Huewe3c0d4462009-09-29 01:34:14 +0200832static void __exit et131x_cleanup_module(void)
Alan Cox7ca5d422009-08-27 11:03:21 +0100833{
834 pci_unregister_driver(&et131x_driver);
835}
836
837module_init(et131x_init_module);
838module_exit(et131x_cleanup_module);
839
Alan Cox7ca5d422009-08-27 11:03:21 +0100840/* Modinfo parameters (filled out using defines from et131x_version.h) */
841MODULE_AUTHOR(DRIVER_AUTHOR);
842MODULE_DESCRIPTION(DRIVER_INFO);
843MODULE_LICENSE(DRIVER_LICENSE);