hermes.c 13.2 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* hermes.c
 *
 * Driver core for the "Hermes" wireless MAC controller, as used in
 * the Lucent Orinoco and Cabletron RoamAbout cards. It should also
 * work on the hfa3841 and hfa3842 MAC controller chips used in the
 * Prism II chipsets.
 *
 * This is not a complete driver, just low-level access routines for
 * the MAC controller itself.
 *
 * Based on the prism2 driver from Absolute Value Systems' linux-wlan
 * project, the Linux wvlan_cs driver, Lucent's HCF-Light
 * (wvlan_hcf.c) library, and the NetBSD wireless driver (in no
 * particular order).
 *
 * Copyright (C) 2000, David Gibson, Linuxcare Australia.
 * (C) Copyright David Gibson, IBM Corp. 2001-2003.
Andrey Borzenkov's avatar
Andrey Borzenkov committed
18
 *
Linus Torvalds's avatar
Linus Torvalds committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License
 * at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 * the License for the specific language governing rights and
 * limitations under the License.
 *
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License version 2 (the "GPL"), in
 * which case the provisions of the GPL are applicable instead of the
 * above.  If you wish to allow the use of your version of this file
 * only under the terms of the GPL and not to allow others to use your
 * version of this file under the MPL, indicate your decision by
 * deleting the provisions above and replace them with the notice and
 * other provisions required by the GPL.  If you do not delete the
 * provisions above, a recipient may use your version of this file
 * under either the MPL or the GPL.
 */

#include <linux/module.h>
#include <linux/kernel.h>
43
44
#include <linux/init.h>
#include <linux/delay.h>
Linus Torvalds's avatar
Linus Torvalds committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#include "hermes.h"

/* These are maximum timeouts. Most often, card wil react much faster */
#define CMD_BUSY_TIMEOUT (100) /* In iterations of ~1us */
#define CMD_INIT_TIMEOUT (50000) /* in iterations of ~10us */
#define CMD_COMPL_TIMEOUT (20000) /* in iterations of ~10us */
#define ALLOC_COMPL_TIMEOUT (1000) /* in iterations of ~10us */

/*
 * Debugging helpers
 */

#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %p: " , hw->iobase); \
Andrey Borzenkov's avatar
Andrey Borzenkov committed
59
			printk(stuff); } while (0)
Linus Torvalds's avatar
Linus Torvalds committed
60
61
62
63
64

#undef HERMES_DEBUG
#ifdef HERMES_DEBUG
#include <stdarg.h>

Andrey Borzenkov's avatar
Andrey Borzenkov committed
65
#define DEBUG(lvl, stuff...) if ((lvl) <= HERMES_DEBUG) DMSG(stuff)
Linus Torvalds's avatar
Linus Torvalds committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

#else /* ! HERMES_DEBUG */

#define DEBUG(lvl, stuff...) do { } while (0)

#endif /* ! HERMES_DEBUG */


/*
 * Internal functions
 */

/* Issue a command to the chip. Waiting for it to complete is the caller's
   problem.

   Returns -EBUSY if the command register is busy, 0 on success.

   Callable from any context.
*/
85
86
static int hermes_issue_cmd(hermes_t *hw, u16 cmd, u16 param0,
			    u16 param1, u16 param2)
Linus Torvalds's avatar
Linus Torvalds committed
87
88
89
90
91
92
{
	int k = CMD_BUSY_TIMEOUT;
	u16 reg;

	/* First wait for the command register to unbusy */
	reg = hermes_read_regn(hw, CMD);
Andrey Borzenkov's avatar
Andrey Borzenkov committed
93
	while ((reg & HERMES_CMD_BUSY) && k) {
Linus Torvalds's avatar
Linus Torvalds committed
94
95
96
97
		k--;
		udelay(1);
		reg = hermes_read_regn(hw, CMD);
	}
Andrey Borzenkov's avatar
Andrey Borzenkov committed
98
	if (reg & HERMES_CMD_BUSY)
Linus Torvalds's avatar
Linus Torvalds committed
99
100
		return -EBUSY;

101
102
	hermes_write_regn(hw, PARAM2, param2);
	hermes_write_regn(hw, PARAM1, param1);
Linus Torvalds's avatar
Linus Torvalds committed
103
104
	hermes_write_regn(hw, PARAM0, param0);
	hermes_write_regn(hw, CMD, cmd);
Andrey Borzenkov's avatar
Andrey Borzenkov committed
105

Linus Torvalds's avatar
Linus Torvalds committed
106
107
108
109
110
111
112
	return 0;
}

/*
 * Function definitions
 */

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/* For doing cmds that wipe the magic constant in SWSUPPORT0 */
int hermes_doicmd_wait(hermes_t *hw, u16 cmd,
		       u16 parm0, u16 parm1, u16 parm2,
		       struct hermes_response *resp)
{
	int err = 0;
	int k;
	u16 status, reg;

	err = hermes_issue_cmd(hw, cmd, parm0, parm1, parm2);
	if (err)
		return err;

	reg = hermes_read_regn(hw, EVSTAT);
	k = CMD_INIT_TIMEOUT;
	while ((!(reg & HERMES_EV_CMD)) && k) {
		k--;
		udelay(10);
		reg = hermes_read_regn(hw, EVSTAT);
	}

	hermes_write_regn(hw, SWSUPPORT0, HERMES_MAGIC);

	if (!hermes_present(hw)) {
		DEBUG(0, "hermes @ 0x%x: Card removed during reset.\n",
		       hw->iobase);
		err = -ENODEV;
		goto out;
	}

	if (!(reg & HERMES_EV_CMD)) {
		printk(KERN_ERR "hermes @ %p: "
		       "Timeout waiting for card to reset (reg=0x%04x)!\n",
		       hw->iobase, reg);
		err = -ETIMEDOUT;
		goto out;
	}

	status = hermes_read_regn(hw, STATUS);
	if (resp) {
		resp->status = status;
		resp->resp0 = hermes_read_regn(hw, RESP0);
		resp->resp1 = hermes_read_regn(hw, RESP1);
		resp->resp2 = hermes_read_regn(hw, RESP2);
	}

	hermes_write_regn(hw, EVACK, HERMES_EV_CMD);

	if (status & HERMES_STATUS_RESULT)
		err = -EIO;
out:
	return err;
}
EXPORT_SYMBOL(hermes_doicmd_wait);

Linus Torvalds's avatar
Linus Torvalds committed
168
169
170
171
172
173
void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing)
{
	hw->iobase = address;
	hw->reg_spacing = reg_spacing;
	hw->inten = 0x0;
}
174
EXPORT_SYMBOL(hermes_struct_init);
Linus Torvalds's avatar
Linus Torvalds committed
175
176
177

int hermes_init(hermes_t *hw)
{
178
	u16 reg;
Linus Torvalds's avatar
Linus Torvalds committed
179
180
181
182
183
184
185
186
187
	int err = 0;
	int k;

	/* We don't want to be interrupted while resetting the chipset */
	hw->inten = 0x0;
	hermes_write_regn(hw, INTEN, 0);
	hermes_write_regn(hw, EVACK, 0xffff);

	/* Normally it's a "can't happen" for the command register to
Andrey Borzenkov's avatar
Andrey Borzenkov committed
188
189
190
191
192
	   be busy when we go to issue a command because we are
	   serializing all commands.  However we want to have some
	   chance of resetting the card even if it gets into a stupid
	   state, so we actually wait to see if the command register
	   will unbusy itself here. */
Linus Torvalds's avatar
Linus Torvalds committed
193
194
195
	k = CMD_BUSY_TIMEOUT;
	reg = hermes_read_regn(hw, CMD);
	while (k && (reg & HERMES_CMD_BUSY)) {
Andrey Borzenkov's avatar
Andrey Borzenkov committed
196
197
		if (reg == 0xffff) /* Special case - the card has probably been
				      removed, so don't wait for the timeout */
Linus Torvalds's avatar
Linus Torvalds committed
198
199
200
201
202
203
			return -ENODEV;

		k--;
		udelay(1);
		reg = hermes_read_regn(hw, CMD);
	}
Andrey Borzenkov's avatar
Andrey Borzenkov committed
204

Linus Torvalds's avatar
Linus Torvalds committed
205
206
207
208
209
210
211
212
213
214
215
	/* No need to explicitly handle the timeout - if we've timed
	   out hermes_issue_cmd() will probably return -EBUSY below */

	/* According to the documentation, EVSTAT may contain
	   obsolete event occurrence information.  We have to acknowledge
	   it by writing EVACK. */
	reg = hermes_read_regn(hw, EVSTAT);
	hermes_write_regn(hw, EVACK, reg);

	/* We don't use hermes_docmd_wait here, because the reset wipes
	   the magic constant in SWSUPPORT0 away, and it gets confused */
216
	err = hermes_doicmd_wait(hw, HERMES_CMD_INIT, 0, 0, 0, NULL);
Linus Torvalds's avatar
Linus Torvalds committed
217
218
219

	return err;
}
220
EXPORT_SYMBOL(hermes_init);
Linus Torvalds's avatar
Linus Torvalds committed
221
222
223
224

/* Issue a command to the chip, and (busy!) wait for it to
 * complete.
 *
Andrey Borzenkov's avatar
Andrey Borzenkov committed
225
226
227
228
 * Returns:
 *     < 0 on internal error
 *       0 on success
 *     > 0 on error returned by the firmware
Linus Torvalds's avatar
Linus Torvalds committed
229
230
231
232
233
234
235
236
237
238
 *
 * Callable from any context, but locking is your problem. */
int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
		      struct hermes_response *resp)
{
	int err;
	int k;
	u16 reg;
	u16 status;

239
	err = hermes_issue_cmd(hw, cmd, parm0, 0, 0);
Linus Torvalds's avatar
Linus Torvalds committed
240
	if (err) {
Andrey Borzenkov's avatar
Andrey Borzenkov committed
241
		if (!hermes_present(hw)) {
Linus Torvalds's avatar
Linus Torvalds committed
242
243
244
245
246
			if (net_ratelimit())
				printk(KERN_WARNING "hermes @ %p: "
				       "Card removed while issuing command "
				       "0x%04x.\n", hw->iobase, cmd);
			err = -ENODEV;
Andrey Borzenkov's avatar
Andrey Borzenkov committed
247
		} else
Linus Torvalds's avatar
Linus Torvalds committed
248
249
250
251
252
253
254
255
256
			if (net_ratelimit())
				printk(KERN_ERR "hermes @ %p: "
				       "Error %d issuing command 0x%04x.\n",
				       hw->iobase, err, cmd);
		goto out;
	}

	reg = hermes_read_regn(hw, EVSTAT);
	k = CMD_COMPL_TIMEOUT;
Andrey Borzenkov's avatar
Andrey Borzenkov committed
257
	while ((!(reg & HERMES_EV_CMD)) && k) {
Linus Torvalds's avatar
Linus Torvalds committed
258
259
260
261
262
		k--;
		udelay(10);
		reg = hermes_read_regn(hw, EVSTAT);
	}

Andrey Borzenkov's avatar
Andrey Borzenkov committed
263
	if (!hermes_present(hw)) {
Linus Torvalds's avatar
Linus Torvalds committed
264
265
266
267
268
269
		printk(KERN_WARNING "hermes @ %p: Card removed "
		       "while waiting for command 0x%04x completion.\n",
		       hw->iobase, cmd);
		err = -ENODEV;
		goto out;
	}
Andrey Borzenkov's avatar
Andrey Borzenkov committed
270
271

	if (!(reg & HERMES_EV_CMD)) {
Linus Torvalds's avatar
Linus Torvalds committed
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
		printk(KERN_ERR "hermes @ %p: Timeout waiting for "
		       "command 0x%04x completion.\n", hw->iobase, cmd);
		err = -ETIMEDOUT;
		goto out;
	}

	status = hermes_read_regn(hw, STATUS);
	if (resp) {
		resp->status = status;
		resp->resp0 = hermes_read_regn(hw, RESP0);
		resp->resp1 = hermes_read_regn(hw, RESP1);
		resp->resp2 = hermes_read_regn(hw, RESP2);
	}

	hermes_write_regn(hw, EVACK, HERMES_EV_CMD);

	if (status & HERMES_STATUS_RESULT)
		err = -EIO;

 out:
	return err;
}
294
EXPORT_SYMBOL(hermes_docmd_wait);
Linus Torvalds's avatar
Linus Torvalds committed
295
296
297
298
299
300

int hermes_allocate(hermes_t *hw, u16 size, u16 *fid)
{
	int err = 0;
	int k;
	u16 reg;
Andrey Borzenkov's avatar
Andrey Borzenkov committed
301
302

	if ((size < HERMES_ALLOC_LEN_MIN) || (size > HERMES_ALLOC_LEN_MAX))
Linus Torvalds's avatar
Linus Torvalds committed
303
304
305
		return -EINVAL;

	err = hermes_docmd_wait(hw, HERMES_CMD_ALLOC, size, NULL);
Andrey Borzenkov's avatar
Andrey Borzenkov committed
306
	if (err)
Linus Torvalds's avatar
Linus Torvalds committed
307
308
309
310
		return err;

	reg = hermes_read_regn(hw, EVSTAT);
	k = ALLOC_COMPL_TIMEOUT;
Andrey Borzenkov's avatar
Andrey Borzenkov committed
311
	while ((!(reg & HERMES_EV_ALLOC)) && k) {
Linus Torvalds's avatar
Linus Torvalds committed
312
313
314
315
		k--;
		udelay(10);
		reg = hermes_read_regn(hw, EVSTAT);
	}
Andrey Borzenkov's avatar
Andrey Borzenkov committed
316
317

	if (!hermes_present(hw)) {
Linus Torvalds's avatar
Linus Torvalds committed
318
319
320
321
322
		printk(KERN_WARNING "hermes @ %p: "
		       "Card removed waiting for frame allocation.\n",
		       hw->iobase);
		return -ENODEV;
	}
Andrey Borzenkov's avatar
Andrey Borzenkov committed
323
324

	if (!(reg & HERMES_EV_ALLOC)) {
Linus Torvalds's avatar
Linus Torvalds committed
325
326
327
328
329
330
331
332
		printk(KERN_ERR "hermes @ %p: "
		       "Timeout waiting for frame allocation\n",
		       hw->iobase);
		return -ETIMEDOUT;
	}

	*fid = hermes_read_regn(hw, ALLOCFID);
	hermes_write_regn(hw, EVACK, HERMES_EV_ALLOC);
Andrey Borzenkov's avatar
Andrey Borzenkov committed
333

Linus Torvalds's avatar
Linus Torvalds committed
334
335
	return 0;
}
336
EXPORT_SYMBOL(hermes_allocate);
Linus Torvalds's avatar
Linus Torvalds committed
337
338
339

/* Set up a BAP to read a particular chunk of data from card's internal buffer.
 *
Andrey Borzenkov's avatar
Andrey Borzenkov committed
340
341
342
343
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error
Linus Torvalds's avatar
Linus Torvalds committed
344
345
346
347
348
349
350
351
352
353
354
 * from firmware
 *
 * Callable from any context */
static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
{
	int sreg = bap ? HERMES_SELECT1 : HERMES_SELECT0;
	int oreg = bap ? HERMES_OFFSET1 : HERMES_OFFSET0;
	int k;
	u16 reg;

	/* Paranoia.. */
Andrey Borzenkov's avatar
Andrey Borzenkov committed
355
	if ((offset > HERMES_BAP_OFFSET_MAX) || (offset % 2))
Linus Torvalds's avatar
Linus Torvalds committed
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
		return -EINVAL;

	k = HERMES_BAP_BUSY_TIMEOUT;
	reg = hermes_read_reg(hw, oreg);
	while ((reg & HERMES_OFFSET_BUSY) && k) {
		k--;
		udelay(1);
		reg = hermes_read_reg(hw, oreg);
	}

	if (reg & HERMES_OFFSET_BUSY)
		return -ETIMEDOUT;

	/* Now we actually set up the transfer */
	hermes_write_reg(hw, sreg, id);
	hermes_write_reg(hw, oreg, offset);

	/* Wait for the BAP to be ready */
	k = HERMES_BAP_BUSY_TIMEOUT;
	reg = hermes_read_reg(hw, oreg);
Andrey Borzenkov's avatar
Andrey Borzenkov committed
376
	while ((reg & (HERMES_OFFSET_BUSY | HERMES_OFFSET_ERR)) && k) {
Linus Torvalds's avatar
Linus Torvalds committed
377
378
379
380
381
382
383
384
385
386
387
		k--;
		udelay(1);
		reg = hermes_read_reg(hw, oreg);
	}

	if (reg != offset) {
		printk(KERN_ERR "hermes @ %p: BAP%d offset %s: "
		       "reg=0x%x id=0x%x offset=0x%x\n", hw->iobase, bap,
		       (reg & HERMES_OFFSET_BUSY) ? "timeout" : "error",
		       reg, id, offset);

Andrey Borzenkov's avatar
Andrey Borzenkov committed
388
		if (reg & HERMES_OFFSET_BUSY)
Linus Torvalds's avatar
Linus Torvalds committed
389
390
391
392
393
394
395
396
397
398
399
400
			return -ETIMEDOUT;

		return -EIO;		/* error or wrong offset */
	}

	return 0;
}

/* Read a block of data from the chip's buffer, via the
 * BAP. Synchronization/serialization is the caller's problem.  len
 * must be even.
 *
Andrey Borzenkov's avatar
Andrey Borzenkov committed
401
402
403
404
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error from firmware
Linus Torvalds's avatar
Linus Torvalds committed
405
 */
406
int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len,
Linus Torvalds's avatar
Linus Torvalds committed
407
408
409
410
411
		     u16 id, u16 offset)
{
	int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
	int err = 0;

Andrey Borzenkov's avatar
Andrey Borzenkov committed
412
	if ((len < 0) || (len % 2))
Linus Torvalds's avatar
Linus Torvalds committed
413
414
415
416
417
418
419
420
421
422
423
424
		return -EINVAL;

	err = hermes_bap_seek(hw, bap, id, offset);
	if (err)
		goto out;

	/* Actually do the transfer */
	hermes_read_words(hw, dreg, buf, len/2);

 out:
	return err;
}
425
EXPORT_SYMBOL(hermes_bap_pread);
Linus Torvalds's avatar
Linus Torvalds committed
426
427

/* Write a block of data to the chip's buffer, via the
428
 * BAP. Synchronization/serialization is the caller's problem.
Linus Torvalds's avatar
Linus Torvalds committed
429
 *
Andrey Borzenkov's avatar
Andrey Borzenkov committed
430
431
432
433
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error from firmware
Linus Torvalds's avatar
Linus Torvalds committed
434
 */
435
int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len,
Linus Torvalds's avatar
Linus Torvalds committed
436
437
438
439
440
		      u16 id, u16 offset)
{
	int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
	int err = 0;

441
	if (len < 0)
Linus Torvalds's avatar
Linus Torvalds committed
442
443
444
445
446
		return -EINVAL;

	err = hermes_bap_seek(hw, bap, id, offset);
	if (err)
		goto out;
Andrey Borzenkov's avatar
Andrey Borzenkov committed
447

Linus Torvalds's avatar
Linus Torvalds committed
448
	/* Actually do the transfer */
449
	hermes_write_bytes(hw, dreg, buf, len);
Linus Torvalds's avatar
Linus Torvalds committed
450

Andrey Borzenkov's avatar
Andrey Borzenkov committed
451
 out:
Linus Torvalds's avatar
Linus Torvalds committed
452
453
	return err;
}
454
EXPORT_SYMBOL(hermes_bap_pwrite);
Linus Torvalds's avatar
Linus Torvalds committed
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471

/* Read a Length-Type-Value record from the card.
 *
 * If length is NULL, we ignore the length read from the card, and
 * read the entire buffer regardless. This is useful because some of
 * the configuration records appear to have incorrect lengths in
 * practice.
 *
 * Callable from user or bh context.  */
int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize,
		    u16 *length, void *buf)
{
	int err = 0;
	int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
	u16 rlength, rtype;
	unsigned nwords;

472
	if (bufsize % 2)
Linus Torvalds's avatar
Linus Torvalds committed
473
474
475
476
477
478
479
480
481
482
483
484
		return -EINVAL;

	err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS, rid, NULL);
	if (err)
		return err;

	err = hermes_bap_seek(hw, bap, rid, 0);
	if (err)
		return err;

	rlength = hermes_read_reg(hw, dreg);

Andrey Borzenkov's avatar
Andrey Borzenkov committed
485
	if (!rlength)
Linus Torvalds's avatar
Linus Torvalds committed
486
487
488
489
490
491
492
493
494
495
		return -ENODATA;

	rtype = hermes_read_reg(hw, dreg);

	if (length)
		*length = rlength;

	if (rtype != rid)
		printk(KERN_WARNING "hermes @ %p: %s(): "
		       "rid (0x%04x) does not match type (0x%04x)\n",
496
		       hw->iobase, __func__, rid, rtype);
Linus Torvalds's avatar
Linus Torvalds committed
497
498
499
500
501
502
503
504
505
506
507
	if (HERMES_RECLEN_TO_BYTES(rlength) > bufsize)
		printk(KERN_WARNING "hermes @ %p: "
		       "Truncating LTV record from %d to %d bytes. "
		       "(rid=0x%04x, len=0x%04x)\n", hw->iobase,
		       HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength);

	nwords = min((unsigned)rlength - 1, bufsize / 2);
	hermes_read_words(hw, dreg, buf, nwords);

	return 0;
}
508
EXPORT_SYMBOL(hermes_read_ltv);
Linus Torvalds's avatar
Linus Torvalds committed
509

Andrey Borzenkov's avatar
Andrey Borzenkov committed
510
int hermes_write_ltv(hermes_t *hw, int bap, u16 rid,
Linus Torvalds's avatar
Linus Torvalds committed
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
		     u16 length, const void *value)
{
	int dreg = bap ? HERMES_DATA1 : HERMES_DATA0;
	int err = 0;
	unsigned count;

	if (length == 0)
		return -EINVAL;

	err = hermes_bap_seek(hw, bap, rid, 0);
	if (err)
		return err;

	hermes_write_reg(hw, dreg, length);
	hermes_write_reg(hw, dreg, rid);

	count = length - 1;

529
	hermes_write_bytes(hw, dreg, value, count << 1);
Linus Torvalds's avatar
Linus Torvalds committed
530

531
	err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS | HERMES_CMD_WRITE,
Linus Torvalds's avatar
Linus Torvalds committed
532
533
534
535
536
				rid, NULL);

	return err;
}
EXPORT_SYMBOL(hermes_write_ltv);