proc: use seq_puts()/seq_putc() where possible
[linux-2.6/next.git] / drivers / net / bna / cna_fwimg.c
blobe8f4ecd9ebb5cd8c70235d891899673059bb76a3
1 /*
2 * Linux network driver for Brocade Converged Network Adapter.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License (GPL) Version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
14 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
15 * All rights reserved
16 * www.brocade.com
18 #include <linux/firmware.h>
19 #include "cna.h"
21 const struct firmware *bfi_fw;
22 static u32 *bfi_image_ct_cna;
23 static u32 bfi_image_ct_cna_size;
25 static u32 *
26 cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
27 u32 *bfi_image_size, char *fw_name)
29 const struct firmware *fw;
31 if (request_firmware(&fw, fw_name, &pdev->dev)) {
32 pr_alert("Can't locate firmware %s\n", fw_name);
33 goto error;
36 *bfi_image = (u32 *)fw->data;
37 *bfi_image_size = fw->size/sizeof(u32);
38 bfi_fw = fw;
40 return *bfi_image;
41 error:
42 return NULL;
45 u32 *
46 cna_get_firmware_buf(struct pci_dev *pdev)
48 if (bfi_image_ct_cna_size == 0)
49 cna_read_firmware(pdev, &bfi_image_ct_cna,
50 &bfi_image_ct_cna_size, CNA_FW_FILE_CT);
51 return bfi_image_ct_cna;
54 u32 *
55 bfa_cb_image_get_chunk(int type, u32 off)
57 return (u32 *)(bfi_image_ct_cna + off);
60 u32
61 bfa_cb_image_get_size(int type)
63 return bfi_image_ct_cna_size;