diff options
author | stephen hemminger <stephen@networkplumber.org> | 2013-12-18 17:16:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-22 18:32:44 -0500 |
commit | de5b867741ec96861fb0021c44113996c9dea42a (patch) | |
tree | 8c5d95bf18b17062cbd13e69ff0fb324d35f9106 /drivers/net/ethernet/chelsio | |
parent | 131334d09cf96d296006df143b024e339e74cd3e (diff) |
cxgb4: make functions static and remove dead code
Cleanup by making local functions static.
The code to load config file is unreachable in net-next, probably came
from some out of tree driver.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 138 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c | 4 |
4 files changed, 8 insertions, 143 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 6c9308850453..17fe50b91523 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | |||
@@ -919,7 +919,6 @@ int t4_seeprom_wp(struct adapter *adapter, bool enable); | |||
919 | int get_vpd_params(struct adapter *adapter, struct vpd_params *p); | 919 | int get_vpd_params(struct adapter *adapter, struct vpd_params *p); |
920 | int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); | 920 | int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); |
921 | unsigned int t4_flash_cfg_addr(struct adapter *adapter); | 921 | unsigned int t4_flash_cfg_addr(struct adapter *adapter); |
922 | int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); | ||
923 | int t4_get_fw_version(struct adapter *adapter, u32 *vers); | 922 | int t4_get_fw_version(struct adapter *adapter, u32 *vers); |
924 | int t4_get_tp_version(struct adapter *adapter, u32 *vers); | 923 | int t4_get_tp_version(struct adapter *adapter, u32 *vers); |
925 | int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, | 924 | int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, |
@@ -958,13 +957,6 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, | |||
958 | int t4_fw_bye(struct adapter *adap, unsigned int mbox); | 957 | int t4_fw_bye(struct adapter *adap, unsigned int mbox); |
959 | int t4_early_init(struct adapter *adap, unsigned int mbox); | 958 | int t4_early_init(struct adapter *adap, unsigned int mbox); |
960 | int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); | 959 | int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); |
961 | int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force); | ||
962 | int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); | ||
963 | int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, | ||
964 | const u8 *fw_data, unsigned int size, int force); | ||
965 | int t4_fw_config_file(struct adapter *adap, unsigned int mbox, | ||
966 | unsigned int mtype, unsigned int maddr, | ||
967 | u32 *finiver, u32 *finicsum, u32 *cfcsum); | ||
968 | int t4_fixup_host_params(struct adapter *adap, unsigned int page_size, | 960 | int t4_fixup_host_params(struct adapter *adap, unsigned int page_size, |
969 | unsigned int cache_line_size); | 961 | unsigned int cache_line_size); |
970 | int t4_fw_initialize(struct adapter *adap, unsigned int mbox); | 962 | int t4_fw_initialize(struct adapter *adap, unsigned int mbox); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c index 74a6fce5a15a..9903a66b7bad 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include "t4_regs.h" | 38 | #include "t4_regs.h" |
39 | #include "t4fw_api.h" | 39 | #include "t4fw_api.h" |
40 | 40 | ||
41 | static int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, | ||
42 | const u8 *fw_data, unsigned int size, int force); | ||
41 | /** | 43 | /** |
42 | * t4_wait_op_done_val - wait until an operation is completed | 44 | * t4_wait_op_done_val - wait until an operation is completed |
43 | * @adapter: the adapter performing the operation | 45 | * @adapter: the adapter performing the operation |
@@ -1070,62 +1072,6 @@ unsigned int t4_flash_cfg_addr(struct adapter *adapter) | |||
1070 | } | 1072 | } |
1071 | 1073 | ||
1072 | /** | 1074 | /** |
1073 | * t4_load_cfg - download config file | ||
1074 | * @adap: the adapter | ||
1075 | * @cfg_data: the cfg text file to write | ||
1076 | * @size: text file size | ||
1077 | * | ||
1078 | * Write the supplied config text file to the card's serial flash. | ||
1079 | */ | ||
1080 | int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) | ||
1081 | { | ||
1082 | int ret, i, n; | ||
1083 | unsigned int addr; | ||
1084 | unsigned int flash_cfg_start_sec; | ||
1085 | unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; | ||
1086 | |||
1087 | addr = t4_flash_cfg_addr(adap); | ||
1088 | flash_cfg_start_sec = addr / SF_SEC_SIZE; | ||
1089 | |||
1090 | if (size > FLASH_CFG_MAX_SIZE) { | ||
1091 | dev_err(adap->pdev_dev, "cfg file too large, max is %u bytes\n", | ||
1092 | FLASH_CFG_MAX_SIZE); | ||
1093 | return -EFBIG; | ||
1094 | } | ||
1095 | |||
1096 | i = DIV_ROUND_UP(FLASH_CFG_MAX_SIZE, /* # of sectors spanned */ | ||
1097 | sf_sec_size); | ||
1098 | ret = t4_flash_erase_sectors(adap, flash_cfg_start_sec, | ||
1099 | flash_cfg_start_sec + i - 1); | ||
1100 | /* | ||
1101 | * If size == 0 then we're simply erasing the FLASH sectors associated | ||
1102 | * with the on-adapter Firmware Configuration File. | ||
1103 | */ | ||
1104 | if (ret || size == 0) | ||
1105 | goto out; | ||
1106 | |||
1107 | /* this will write to the flash up to SF_PAGE_SIZE at a time */ | ||
1108 | for (i = 0; i < size; i += SF_PAGE_SIZE) { | ||
1109 | if ((size - i) < SF_PAGE_SIZE) | ||
1110 | n = size - i; | ||
1111 | else | ||
1112 | n = SF_PAGE_SIZE; | ||
1113 | ret = t4_write_flash(adap, addr, n, cfg_data); | ||
1114 | if (ret) | ||
1115 | goto out; | ||
1116 | |||
1117 | addr += SF_PAGE_SIZE; | ||
1118 | cfg_data += SF_PAGE_SIZE; | ||
1119 | } | ||
1120 | |||
1121 | out: | ||
1122 | if (ret) | ||
1123 | dev_err(adap->pdev_dev, "config file %s failed %d\n", | ||
1124 | (size == 0 ? "clear" : "download"), ret); | ||
1125 | return ret; | ||
1126 | } | ||
1127 | |||
1128 | /** | ||
1129 | * t4_load_fw - download firmware | 1075 | * t4_load_fw - download firmware |
1130 | * @adap: the adapter | 1076 | * @adap: the adapter |
1131 | * @fw_data: the firmware image to write | 1077 | * @fw_data: the firmware image to write |
@@ -2810,7 +2756,7 @@ int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset) | |||
2810 | * be doing. The only way out of this state is to RESTART the firmware | 2756 | * be doing. The only way out of this state is to RESTART the firmware |
2811 | * ... | 2757 | * ... |
2812 | */ | 2758 | */ |
2813 | int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) | 2759 | static int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) |
2814 | { | 2760 | { |
2815 | int ret = 0; | 2761 | int ret = 0; |
2816 | 2762 | ||
@@ -2875,7 +2821,7 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) | |||
2875 | * the chip since older firmware won't recognize the PCIE_FW.HALT | 2821 | * the chip since older firmware won't recognize the PCIE_FW.HALT |
2876 | * flag and automatically RESET itself on startup. | 2822 | * flag and automatically RESET itself on startup. |
2877 | */ | 2823 | */ |
2878 | int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset) | 2824 | static int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset) |
2879 | { | 2825 | { |
2880 | if (reset) { | 2826 | if (reset) { |
2881 | /* | 2827 | /* |
@@ -2938,8 +2884,8 @@ int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset) | |||
2938 | * positive errno indicates that the adapter is ~probably~ intact, a | 2884 | * positive errno indicates that the adapter is ~probably~ intact, a |
2939 | * negative errno indicates that things are looking bad ... | 2885 | * negative errno indicates that things are looking bad ... |
2940 | */ | 2886 | */ |
2941 | int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, | 2887 | static int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, |
2942 | const u8 *fw_data, unsigned int size, int force) | 2888 | const u8 *fw_data, unsigned int size, int force) |
2943 | { | 2889 | { |
2944 | const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; | 2890 | const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; |
2945 | int reset, ret; | 2891 | int reset, ret; |
@@ -2964,78 +2910,6 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, | |||
2964 | return t4_fw_restart(adap, mbox, reset); | 2910 | return t4_fw_restart(adap, mbox, reset); |
2965 | } | 2911 | } |
2966 | 2912 | ||
2967 | |||
2968 | /** | ||
2969 | * t4_fw_config_file - setup an adapter via a Configuration File | ||
2970 | * @adap: the adapter | ||
2971 | * @mbox: mailbox to use for the FW command | ||
2972 | * @mtype: the memory type where the Configuration File is located | ||
2973 | * @maddr: the memory address where the Configuration File is located | ||
2974 | * @finiver: return value for CF [fini] version | ||
2975 | * @finicsum: return value for CF [fini] checksum | ||
2976 | * @cfcsum: return value for CF computed checksum | ||
2977 | * | ||
2978 | * Issue a command to get the firmware to process the Configuration | ||
2979 | * File located at the specified mtype/maddress. If the Configuration | ||
2980 | * File is processed successfully and return value pointers are | ||
2981 | * provided, the Configuration File "[fini] section version and | ||
2982 | * checksum values will be returned along with the computed checksum. | ||
2983 | * It's up to the caller to decide how it wants to respond to the | ||
2984 | * checksums not matching but it recommended that a prominant warning | ||
2985 | * be emitted in order to help people rapidly identify changed or | ||
2986 | * corrupted Configuration Files. | ||
2987 | * | ||
2988 | * Also note that it's possible to modify things like "niccaps", | ||
2989 | * "toecaps",etc. between processing the Configuration File and telling | ||
2990 | * the firmware to use the new configuration. Callers which want to | ||
2991 | * do this will need to "hand-roll" their own CAPS_CONFIGS commands for | ||
2992 | * Configuration Files if they want to do this. | ||
2993 | */ | ||
2994 | int t4_fw_config_file(struct adapter *adap, unsigned int mbox, | ||
2995 | unsigned int mtype, unsigned int maddr, | ||
2996 | u32 *finiver, u32 *finicsum, u32 *cfcsum) | ||
2997 | { | ||
2998 | struct fw_caps_config_cmd caps_cmd; | ||
2999 | int ret; | ||
3000 | |||
3001 | /* | ||
3002 | * Tell the firmware to process the indicated Configuration File. | ||
3003 | * If there are no errors and the caller has provided return value | ||
3004 | * pointers for the [fini] section version, checksum and computed | ||
3005 | * checksum, pass those back to the caller. | ||
3006 | */ | ||
3007 | memset(&caps_cmd, 0, sizeof(caps_cmd)); | ||
3008 | caps_cmd.op_to_write = | ||
3009 | htonl(FW_CMD_OP(FW_CAPS_CONFIG_CMD) | | ||
3010 | FW_CMD_REQUEST | | ||
3011 | FW_CMD_READ); | ||
3012 | caps_cmd.cfvalid_to_len16 = | ||
3013 | htonl(FW_CAPS_CONFIG_CMD_CFVALID | | ||
3014 | FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | | ||
3015 | FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(maddr >> 16) | | ||
3016 | FW_LEN16(caps_cmd)); | ||
3017 | ret = t4_wr_mbox(adap, mbox, &caps_cmd, sizeof(caps_cmd), &caps_cmd); | ||
3018 | if (ret < 0) | ||
3019 | return ret; | ||
3020 | |||
3021 | if (finiver) | ||
3022 | *finiver = ntohl(caps_cmd.finiver); | ||
3023 | if (finicsum) | ||
3024 | *finicsum = ntohl(caps_cmd.finicsum); | ||
3025 | if (cfcsum) | ||
3026 | *cfcsum = ntohl(caps_cmd.cfcsum); | ||
3027 | |||
3028 | /* | ||
3029 | * And now tell the firmware to use the configuration we just loaded. | ||
3030 | */ | ||
3031 | caps_cmd.op_to_write = | ||
3032 | htonl(FW_CMD_OP(FW_CAPS_CONFIG_CMD) | | ||
3033 | FW_CMD_REQUEST | | ||
3034 | FW_CMD_WRITE); | ||
3035 | caps_cmd.cfvalid_to_len16 = htonl(FW_LEN16(caps_cmd)); | ||
3036 | return t4_wr_mbox(adap, mbox, &caps_cmd, sizeof(caps_cmd), NULL); | ||
3037 | } | ||
3038 | |||
3039 | /** | 2913 | /** |
3040 | * t4_fixup_host_params - fix up host-dependent parameters | 2914 | * t4_fixup_host_params - fix up host-dependent parameters |
3041 | * @adap: the adapter | 2915 | * @adap: the adapter |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h index 61362450d05b..f412d0fa0850 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h +++ b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h | |||
@@ -268,7 +268,6 @@ int t4vf_wait_dev_ready(struct adapter *); | |||
268 | int t4vf_port_init(struct adapter *, int); | 268 | int t4vf_port_init(struct adapter *, int); |
269 | 269 | ||
270 | int t4vf_fw_reset(struct adapter *); | 270 | int t4vf_fw_reset(struct adapter *); |
271 | int t4vf_query_params(struct adapter *, unsigned int, const u32 *, u32 *); | ||
272 | int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *); | 271 | int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *); |
273 | 272 | ||
274 | int t4vf_get_sge_params(struct adapter *); | 273 | int t4vf_get_sge_params(struct adapter *); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c index d958c44341b5..25dfeb8f28ed 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c | |||
@@ -363,8 +363,8 @@ int t4vf_fw_reset(struct adapter *adapter) | |||
363 | * Reads the values of firmware or device parameters. Up to 7 parameters | 363 | * Reads the values of firmware or device parameters. Up to 7 parameters |
364 | * can be queried at once. | 364 | * can be queried at once. |
365 | */ | 365 | */ |
366 | int t4vf_query_params(struct adapter *adapter, unsigned int nparams, | 366 | static int t4vf_query_params(struct adapter *adapter, unsigned int nparams, |
367 | const u32 *params, u32 *vals) | 367 | const u32 *params, u32 *vals) |
368 | { | 368 | { |
369 | int i, ret; | 369 | int i, ret; |
370 | struct fw_params_cmd cmd, rpl; | 370 | struct fw_params_cmd cmd, rpl; |