smc91c92_cs: use request_firmware

Added osi_load_firmware() instead of copying same thing twice
Signed-off-by: 's avatarJaswinder Singh Rajput <jaswinderrajput@gmail.com>
parent 4b6ece97
This diff is collapsed.
......@@ -42,6 +42,7 @@
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/jiffies.h>
#include <linux/firmware.h>
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
......@@ -55,17 +56,18 @@
#include <asm/system.h>
#include <asm/uaccess.h>
/* Ositech Seven of Diamonds firmware */
#include "ositech.h"
/*====================================================================*/
static const char *if_names[] = { "auto", "10baseT", "10base2"};
/* Firmware name */
#define FIRMWARE_NAME "ositech/Xilinx7OD.bin"
/* Module parameters */
MODULE_DESCRIPTION("SMC 91c92 series PCMCIA ethernet driver");
MODULE_LICENSE("GPL");
MODULE_FIRMWARE(FIRMWARE_NAME);
#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
......@@ -771,6 +773,26 @@ static int osi_config(struct pcmcia_device *link)
return i;
}
static int osi_load_firmware(struct pcmcia_device *link)
{
const struct firmware *fw;
int i, err;
err = request_firmware(&fw, FIRMWARE_NAME, &link->dev);
if (err) {
pr_err("Failed to load firmware \"%s\"\n", FIRMWARE_NAME);
return err;
}
/* Download the Seven of Diamonds firmware */
for (i = 0; i < fw->size; i++) {
outb(fw->data[i], link->io.BasePort1 + 2);
udelay(50);
}
release_firmware(fw);
return err;
}
static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)
{
struct net_device *dev = link->priv;
......@@ -811,11 +833,9 @@ static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)
(cardid == PRODID_OSITECH_SEVEN)) ||
((manfid == MANFID_PSION) &&
(cardid == PRODID_PSION_NET100))) {
/* Download the Seven of Diamonds firmware */
for (i = 0; i < sizeof(__Xilinx7OD); i++) {
outb(__Xilinx7OD[i], link->io.BasePort1+2);
udelay(50);
}
rc = osi_load_firmware(link);
if (rc)
goto free_cfg_mem;
} else if (manfid == MANFID_OSITECH) {
/* Make sure both functions are powered up */
set_bits(0x300, link->io.BasePort1 + OSITECH_AUI_PWR);
......@@ -862,10 +882,10 @@ static int smc91c92_resume(struct pcmcia_device *link)
(smc->cardid == PRODID_OSITECH_SEVEN)) ||
((smc->manfid == MANFID_PSION) &&
(smc->cardid == PRODID_PSION_NET100))) {
/* Download the Seven of Diamonds firmware */
for (i = 0; i < sizeof(__Xilinx7OD); i++) {
outb(__Xilinx7OD[i], link->io.BasePort1+2);
udelay(50);
i = osi_load_firmware(link);
if (i) {
pr_err("smc91c92_cs: Failed to load firmware\n");
return i;
}
}
if (link->open) {
......
......@@ -40,6 +40,7 @@ fw-shipped-$(CONFIG_CHELSIO_T3) += cxgb3/t3b_psram-1.1.0.bin \
fw-shipped-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin
fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \
e100/d102e_ucode.bin
fw-shipped-$(CONFIG_PCMCIA_SMC91C92) += ositech/Xilinx7OD.bin
fw-shipped-$(CONFIG_SMCTR) += tr_smctr.bin
fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp
fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \
......
......@@ -531,3 +531,15 @@ Licence:
Found in hex form in kernel source.
--------------------------------------------------------------------------
Driver: PCMCIA_SMC91C92 - SMC 91Cxx PCMCIA
File: ositech/Xilinx7OD.bin
Licence: Allegedly GPL, but no source visible. Marked:
This file contains the firmware of Seven of Diamonds from OSITECH.
(Special thanks to Kevin MacPherson of OSITECH)
Found in hex form in kernel source.
--------------------------------------------------------------------------
:10000000FF04A036F3ECFFFFFFDFFBFFF3FFFFFF72
:10001000EF3FFFF7FFFFFFFFEF7FFEFFCEFEFEFE8D
:10002000FEDEBDDDFDFFFDCFF7BF7FFF7F3FFEBFE3
:10003000FFFFFFBCFFFFBDB57F7FBFBF7FFFEFFFAF
:10004000FFFFFBFFF7F7FFFFFFFFFEDEFEFEFADE1E
:10005000BDFDEDFDFDCFEFEFEFEFC7DFDFDFDFDF52
:10006000FF7EFEFD7D6DEEFE7CFBF4FBCFDBDFFF54
:10007000FFBB7FFF7FFFF7FF9EBF3BBFBF7F7F7F41
:100080007E6FDFEFF5F6FDF6F5EDEBFFEFEFEF7EC0
:100090007F7F6F7FFFFEFEFEFEFEEFBFFFFFFFFFD5
:1000A000FFFFFFFFFFFFBC1F1FEEFFBCB7FFDFFF1F
:1000B000DFEF3BE3D3FFFBFFFFDFFFFFFFBABF2D07
:1000C000DBBDFDDBDFFAFBFFEFFBDBF3FFDFFD7FDB
:1000D000EFFBFFFFBEBF27BAFEFBDFFFF6FFFFEF20
:1000E000FBDBF3D99A3FFFAFBFFFFFBE3F37BD96A3
:1000F000FFFFFFFFFFFFAEFBF3F3EBFFFFFFFFFF91
:10010000FFF7FABCAEFEBEFEBB7FFDFF7FEFF7FB45
:10011000BBD7F77FFFF7FFFFF7BCEDFDBD9D7D7BF4
:10012000FB7B7BFBAFFFFEFDFDFEFEFFFFFFFFF74E
:10013000AAB9BF8FBFDFFF7FFFFF7FCFFBEBCBEB0A
:10014000EEFFFFD7FFFFFF3E333F1C7CFCFFFFFFAE
:10015000FFFFCFD3F3E3F3FBFFFFFFFFFFEBFE3522
:100160003F3DFDFDFFFFFFBFFFEF6FE3E3E3EFFF69
:10017000FFDFFFFFF7FE3E5EFEFFFFFFFFFDFFFF1D
:10018000AFCFF2CBCF8EFFFFFFFFFFFDFC3E1F9EE8
:10019000ADFDFFFFBFFFFFEFFFB3F7E7F7FAFFFF8C
:1001A000FFFFFFEEEBABAF9FE37FFFDEFF7FEEFFD6
:1001B000FFFB3AFAFFF277FFFFF7FEFFFEBDAEDE70
:1001C0007D7DFDFFBFEEFFFDFFDBFBFFF7EFFBFFDC
:1001D000FFFEFF2DAFB9FD79FBFAFFBFEFFFFF91E7
:1001E000FAFBDFF7F7FFFFFFFCCF37BFBFFF7F7FD3
:1001F000FFFFFFAFFFFFF3FBFBFFF5EFFFFFF7FA9A
:10020000FFFFEEFAFEFB55DDFF7FAFFEFFFBFBF5C8
:10021000FFF7EFFFFFFFBEBDBDBDBD7D7B7B7B7BE1
:10022000FBAEFFFDFEFFFFFFFFFFFFFFF7DAB76149
:10023000FFB959F373F3DF7F6FDFEFF7EBEBD7FF16
:10024000D7FFFFF7FE7FFB3E3873F67FFCFFFFCF43
:10025000FFB7FBB3B367FFE7FDFFEFF67FB7BCF572
:100260007BF6F7F5FFFFEFFFF7FFF7CEE7FF9FFF06
:10027000FFF5FE7DFF5FFFFFFFFFFFFFFFEFFFF6D4
:10028000CBDBEEFEFFDFFFFFFFFE7FBE1E3EFEFF6D
:100290007DFEFFFFEFBFE7FFE3E3FFDFE7FFFFFFC9
:1002A000B8EFB72FEEFFDFFFBFFF7FEFEBBFA3D3AA
:1002B000FF7FFFFFFFFFF7BEFD3FCFFDFBFFFFFF0F
:1002C000FFFFAFFBBFBBBFDBFDFBFFFFFFFF3EFE42
:1002D0003FBABAFEFFFFFFEFFFEFC37FB29BFFFF06
:1002E000FFFFFEFFFF3CFF3F3CFFFEFFFFFFFFFF66
:1002F000AFF3FEF3E3EBFFFFFFFBFFF79AFEAF9ECA
:10030000BEFEFFDFFFFF7BEFF7BFFBFBFBFFFF7FC7
:10031000FFFFFFBCBDFDBDDD7D7B7B7B7BFBAEFFBF
:10032000FFFFFEFEFFFDFFFFFFF79AFF9FFFAFEF0E
:10033000FFFFFFFF7FCFF3FFEBFFEBFFFFBFFFFFF1
:10034000EFFEFF37FCBFFFFFFFFFFFFFCFEFFDF327
:10035000FFEEFEFFFFFFFFFF6EFD2FFDFFFDFFFF26
:10036000FFFFFFEFCFFFF3BF69FFFFFFFFFFFFFEC0
:10037000FB9FFFBFFDFFFFFFFFFFEF87FEDAEFCF21
:10038000FFFFFFFFFFFFFEEFBFEFEFFDFFFFFFFFF0
:10039000FFEFFDFF7BFFEBFEFFFFFFFFEBF8FFEF43
:1003A000AFFFFFBDFFFFFF7FEE7FEFFFBBFFBFFB98
:1003B000FFFFFFF7F6FBBDFDDDF5FFFFFFFFFFAF22
:1003C000FF5FF5DFFF7FFFFFFFFFFFF6F3FFDEFEBE
:1003D000EFFDFFFFFFFFEFFFDEDF5FDFFDFFFFFF52
:1003E000FFFFFEFFFFFEFEFFFDFFFFFFFFAFFFFF72
:1003F000EFEDFFDFFFFFFBFFFFDABDBEAEFE7FFDCF
:10040000DFFFFF7FEFFFFBFBFB7FF7FFFFFFFFF748
:10041000BCFDBDBDBDFD7B7B7B7BFBAEFFFFFDFF60
:10042000FFFFFDFFFFFFFFFA9FBFBFCF7FFFFFFF73
:10043000FFFFAFFFEBEBEBFFD7FEFFFFBFE7FEBF1A
:100440007FFCFFFFEDFFFFFFFF4FFFFBFBFFFFDD2B
:10045000FFFFFFFFFFFEBDDF9DFDDFB9FFFFFFFFD9
:10046000EFFFFBEFEBFFDEFFFFFFFFFFF69FFFFC61
:10047000FEFBFDFFFFFFFFEFDFFACDCFBF9FFFFFCA
:10048000FFFFF7FEBFFFDFEF5FFFFFFFFF7F6FFFA5
:10049000BBFDFFFFFFFFFFFFFFFF7EFF5FFFBFBF53
:1004A000F9FFFFFF7F6E7BFFEFFDEBDFFFFFFFFF3D
:1004B000F7B63EFCFDBF7EFBFFFFFFF7EFF7F3F75C
:1004C000FFFBFFFFFFFFFFFF6E3579FFBFFCFFFF64
:1004D000FFFFFFEFFB53DFFFEBBFFFFFFFFFFFBCA3
:1004E000FFFFFFBFFFFDFFFFFFFFAFF5FFF7FFFBC4
:1004F000FFFFFFFFFFFFBAAAEEFE3F7DFDFFFFFFFC
:100500007FAF77FBFBFFFBF7FFFFFFFFF7BEBDBD34
:10051000BDBDFD7B7B7B7BFBAEFFEFFFFFFFFFFCE9
:10052000FFFFFFFF9AD9B8FFFF79FFFFFFFFFFCF63
:10053000FBFFEBFFEBD7FFFFFFFFE7DEF8FBFE3F24
:10054000FBFDFFFFFFFFCFADBFFAFF73DFFFFFFF34
:10055000FFFF3AF5B7FC3FF9FDFFFFFF7FEFF3FF29
:10056000BFFEF39FFEFFFFFFF73EFFFFFFBFFFFF52
:10057000FFFFFFFFAFD3FEDBFFDBDFFFFFFFFFFF70
:100580003EFFBFFF7FFFFDFFFFFFFF8FF3FFEDFF8C
:10059000F7FBFFFFFFFFEFF63CFEFFFFFFFFFFFF54
:1005A000FF9FEFEFD1FFFFFFFFFFFFFFFFFF7EBFCA
:1005B000FDFFFFFFFFFFFFFFBBEFDFF1FFFFFFFFCF
:1005C000FFFFFFFFFFEE3EFEFFFFFFFFFFFFFFBF4E
:1005D000EFFDC3FFFFFFFFFFFFFFBFFFFC3EFEFF7E
:1005E000FFFFFFFFFFFFFF2EEFF3FFFFFFFFFFFF08
:1005F000FFFFF7BABEFEFFFFFFFFFFFFFF7FAFFB6E
:10060000FBFDFFFFFFFEFFFFFFF2D6EDBDBDBD7D91
:100610007B7B7B7BFBAFDFFFFFFFFFFFFFFFFFFF6E
:10062000FF92BFFFFFFFFFFFFFFFFF7FAFEBEBFF7F
:10063000FFFFFFFFFFFFFFE7FE2EFEFFFFFFFFFFB5
:10064000FFFFFF4FEFF3FFFFFFFFFFFFFFFFFFFE87
:100650003CFEFFFFFFFFFFFFFFFFEFCEC3FDFFFFED
:10066000FFFFFFFFFFFFFE5DFFFFFFFFFFFFFFFF3D
:10067000FFEFCFEBFFFFFFFFFFFFFFFFF7EE3EFFB8
:10068000FFFFFFFFFFFFFF7FEFDFE2FFFFFFFBFF4B
:10069000FFFFFFFFF6BEFCFFFFFFFFFFFFFF7FEE48
:1006A0005FE6FFFFFFFFFFFFFFFFFF3E7DFFFFFF56
:1006B000FFFFFFFFFFFFEFF3FBFFFFFFFFFFFFFF6A
:1006C000BFF736BEFEFFFFFFFFFFFFFFFFEFD3F6D2
:1006D000FEFFFFFFFFFFFFFFFFFC7FEEFFFFFFFFBF
:1006E000FFFFFFFFAFEFEBFFFFFFFFFFFFFFFFFF8E
:1006F000BABEFEFFFFFFFFFFFFFFFFEEFBFAFFFFAB
:10070000FFFFFFFFFFFFF7D6FDBDBDBD7D7B7B7B00
:100710007BFBAEFF7EFFFFFFFFFFFFFFFFF7BABFD0
:10072000FFFFFFFFFFFFFFFF7FEFEB6BFFFFFFFF11
:10073000FFFFFFFFF7FEBEFEFFFFFFFFFFFFFFFF14
:100740004FEFF7FFFFFFFFFFFFFFFFEF3E6EFCFFE6
:10075000FFFFFFFFFFFFFFEFC3C9FFFFFFFFFFFF2B
:10076000FFFFFF3EBFFFFFFFFFFFFFFFFFFFEFFBAE
:10077000D5FFFFFFFFFFFFFFFFFFFEFEFEFFFFFFB6
:10078000FFFFFFFFFF6FEFFBFFFFFFFBFFFFFFFF21
:10079000FFF6DFFFFFFFFFFFFFFF7FFEEFFFFFFF23
:1007A000FFFFFFFFFFFFE7FFFEFFF7FFFFFFFFFF7A
:1007B000FF7FFAEFBFFFFFFFFFFFFFFFFFE7FFFE37
:1007C000FFFFFFFFFFFFFFFF7FFEEFBFFFFFFFFF0A
:1007D000FFFFFFFFA7FFFCF7FFFFFFFFFFFFFF7F0C
:1007E000FEAEFFFFFDFFFFFFFFFFFFE7F7FAFFFD94
:1007F000FFFFFFFFFFFFFF7FAFFFFFFFFFFFFFFFD9
:10080000FFFFFFF7BEBDBDBDBD7D7B7B7B7BFBAF2F
:100810007FFFFFFFFFFFFFFFFFFFFFCAFFFFFFFF9D
:10082000FFFFFFFFFF7F6FFFFFFFFFFFFFFFFFFFE8
:10083000FFE7FEFFFFFFFFFFFFFFFFFFFFCFFEFF12
:10084000FFFFFFFFFFFFFFFFFFFEDFFFFFFFFFFFD9
:10085000FFFFFFFFEFFFFEFFFFFFFFFFFFFFFFFFB9
:10086000FEFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFA9
:10087000FFFFFFFFFFFFF7FEFFFFFFFFFFFFFFFF91
:10088000FFFFEFFFFEFFFFFFFBFFFFFFFFE7F2FCB5
:10089000EFFFFFFFFFFFFFFF7FAEEFFFFFFFFFFF59
:1008A000FFFFFFFFF77EFDFFFFFFFFFFFFFFFFFFE3
:1008B000EFFFFEFFFFFFBFFFFFFFBFFFFEFEFFFFDB
:1008C000FFFFFFFFFFFFDFEFDDFEFFFFFFFFFFFF8B
:1008D000FFFFFFFEFEFFFFFFFFFFFFFFFFFFAFEF8A
:1008E000FFFFFFFFFFFFFFFFFFFFBAFEFFFFFFFF5E
:1008F000FFFFFFFFFFEFFAFEFFFFFFFFFFFFFFFF1E
:10090000F69CBDBDBDBD7D7B7B7B7BFBAEFFFFFF52
:10091000FFFFFFFFFFFFFFF77AFFFFFFFFDFFFFF94
:10092000FFFF6FEFF7FFFFFFDFFFFFFFFFFFF7FEA8
:10093000FEFFFFFFDFFFFFFFFFFFCFEBFFFFFFFF2C
:10094000FFFFFFFFFFEF9EFCFFFFFFFFFFFFFFFF2B
:10095000FFEFEFFFFFFFFFFFFFFFFFFFFFFEFFFFC8
:10096000FFFFFFFFFFFFFF7FEFCBFFFFFFFFFFFD5D
:10097000FFFFFFFFBEFDFFFFFFFFFFFFFFFFFFEFDA
:10098000EFFFFFFFDFFFFFFFFFFFFFF8FFFFFFFFAE
:10099000BFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFB7
:1009A000FFFFFEFFFFFFFFFFFFFFFFFFFBAF7FFF2C
:1009B000FFFFDFFFFFFFFFFFFFFEEFFFFFFFFFFF78
:1009C000FFFFFFFFEFFFFFFFFFFFFFFFFFFFBFFF87
:1009D000FEFFFFFFFFFFFFFFFFFFFFAEFFFFFFFF79
:1009E000FFFFFFFFFFFFF7FAFFFFFFFFFFFFFFFF24
:1009F000FF7FEFFFFFFFFFFFFFFFFFFFFFF7BCBD24
:100A0000BDBDBD7D7B7B7B7BFBAFFFFFFFFFFFFFA2
:100A1000FFFFFFFFF7FAFFFFFFFFFFFFFFFFFF7F73
:100A2000AF7FFFFFFFFFFFFFFFFFFFEFFEFFFFFFB7
:100A3000FFFFFFFFFFFFFFCFFFFFFFFFFFFFFFFFF6
:100A4000FFFFFFFEFFFFFFFFFFFFFBFFFFFFEFFFCB
:100A5000FFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFA7
:100A6000FFFFFFFFFFEFFFFFFFFFFFFFBFFFFFFFE6
:100A7000FFFCFFFFFFFFFFFFFFFFFFFFEFFFFFFF99
:100A8000FFFFFBFFFFFFFFEFFEFF9F9F9F3F3F3FEB
:100A90003F3FFFEFDFDFDFDFCFB7BFBFBFBFFFBC31
:100AA000B99DBDBD7D7B7B7B7BFBEFD7F5F3F1D1A2
:100AB00065E3E3E3A3FFFE7FFEDEDEFFBDBDBDBD5C
:100AC000DFEFFBF7F3F3F3E7E7E7E7E7FBFEFFFF13
:0A0AD000FFFFFFFFFFFFFFFFFFFF26
:00000001FF
This file contains the firmware of Seven of Diamonds from OSITECH.
(Special thanks to Kevin MacPherson of OSITECH)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment