attach.c (1846ac3dbec0894095520b2756b68c4fd81e3fbb) attach.c (c47faa364cfb249d5d7670fb7293a6f9acd8aa9e)
1/*
2 * Copyright (c) 2004-2008 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2008 Nick Kossifidis <mickflemm@gmail.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 13 unchanged lines hidden (view full) ---

22
23#include <linux/pci.h>
24#include <linux/slab.h>
25#include "ath5k.h"
26#include "reg.h"
27#include "debug.h"
28
29/**
1/*
2 * Copyright (c) 2004-2008 Reyk Floeter <reyk@openbsd.org>
3 * Copyright (c) 2006-2008 Nick Kossifidis <mickflemm@gmail.com>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 13 unchanged lines hidden (view full) ---

22
23#include <linux/pci.h>
24#include <linux/slab.h>
25#include "ath5k.h"
26#include "reg.h"
27#include "debug.h"
28
29/**
30 * ath5k_hw_post - Power On Self Test helper function
31 *
30 * ath5k_hw_post() - Power On Self Test helper function
32 * @ah: The &struct ath5k_hw
33 */
34static int ath5k_hw_post(struct ath5k_hw *ah)
35{
36
37 static const u32 static_pattern[4] = {
38 0x55555555, 0xaaaaaaaa,
39 0x66666666, 0x99999999

--- 47 unchanged lines hidden (view full) ---

87
88 }
89
90 return 0;
91
92}
93
94/**
31 * @ah: The &struct ath5k_hw
32 */
33static int ath5k_hw_post(struct ath5k_hw *ah)
34{
35
36 static const u32 static_pattern[4] = {
37 0x55555555, 0xaaaaaaaa,
38 0x66666666, 0x99999999

--- 47 unchanged lines hidden (view full) ---

86
87 }
88
89 return 0;
90
91}
92
93/**
95 * ath5k_hw_init - Check if hw is supported and init the needed structs
96 *
94 * ath5k_hw_init() - Check if hw is supported and init the needed structs
97 * @ah: The &struct ath5k_hw associated with the device
98 *
99 * Check if the device is supported, perform a POST and initialize the needed
100 * structs. Returns -ENOMEM if we don't have memory for the needed structs,
101 * -ENODEV if the device is not supported or prints an error msg if something
102 * else went wrong.
103 */
104int ath5k_hw_init(struct ath5k_hw *ah)

--- 239 unchanged lines hidden (view full) ---

344 ath5k_hw_set_ledstate(ah, AR5K_LED_INIT);
345
346 return 0;
347err:
348 return ret;
349}
350
351/**
95 * @ah: The &struct ath5k_hw associated with the device
96 *
97 * Check if the device is supported, perform a POST and initialize the needed
98 * structs. Returns -ENOMEM if we don't have memory for the needed structs,
99 * -ENODEV if the device is not supported or prints an error msg if something
100 * else went wrong.
101 */
102int ath5k_hw_init(struct ath5k_hw *ah)

--- 239 unchanged lines hidden (view full) ---

342 ath5k_hw_set_ledstate(ah, AR5K_LED_INIT);
343
344 return 0;
345err:
346 return ret;
347}
348
349/**
352 * ath5k_hw_deinit - Free the ath5k_hw struct
353 *
350 * ath5k_hw_deinit() - Free the &struct ath5k_hw
354 * @ah: The &struct ath5k_hw
355 */
356void ath5k_hw_deinit(struct ath5k_hw *ah)
357{
358 __set_bit(ATH_STAT_INVALID, ah->status);
359
360 if (ah->ah_rf_banks != NULL)
361 kfree(ah->ah_rf_banks);
362
363 ath5k_eeprom_detach(ah);
364
365 /* assume interrupts are down */
366}
351 * @ah: The &struct ath5k_hw
352 */
353void ath5k_hw_deinit(struct ath5k_hw *ah)
354{
355 __set_bit(ATH_STAT_INVALID, ah->status);
356
357 if (ah->ah_rf_banks != NULL)
358 kfree(ah->ah_rf_banks);
359
360 ath5k_eeprom_detach(ah);
361
362 /* assume interrupts are down */
363}