aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-4965-ucode.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-ucode.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c b/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
index 3c9df1bb5afe..d4dc597452ea 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-ucode.c
@@ -48,22 +48,22 @@
48 * it's a pretty good bet that everything between them is good, too. 48 * it's a pretty good bet that everything between them is good, too.
49 */ 49 */
50static int 50static int
51il4965_verify_inst_sparse(struct il_priv *priv, __le32 *image, u32 len) 51il4965_verify_inst_sparse(struct il_priv *il, __le32 *image, u32 len)
52{ 52{
53 u32 val; 53 u32 val;
54 int ret = 0; 54 int ret = 0;
55 u32 errcnt = 0; 55 u32 errcnt = 0;
56 u32 i; 56 u32 i;
57 57
58 IL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len); 58 IL_DEBUG_INFO(il, "ucode inst image size is %u\n", len);
59 59
60 for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) { 60 for (i = 0; i < len; i += 100, image += 100/sizeof(u32)) {
61 /* read data comes through single port, auto-incr addr */ 61 /* read data comes through single port, auto-incr addr */
62 /* NOTE: Use the debugless read so we don't flood kernel log 62 /* NOTE: Use the debugless read so we don't flood kernel log
63 * if IL_DL_IO is set */ 63 * if IL_DL_IO is set */
64 il_write_direct32(priv, HBUS_TARG_MEM_RADDR, 64 il_write_direct32(il, HBUS_TARG_MEM_RADDR,
65 i + IWL4965_RTC_INST_LOWER_BOUND); 65 i + IWL4965_RTC_INST_LOWER_BOUND);
66 val = _il_read_direct32(priv, HBUS_TARG_MEM_RDAT); 66 val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT);
67 if (val != le32_to_cpu(*image)) { 67 if (val != le32_to_cpu(*image)) {
68 ret = -EIO; 68 ret = -EIO;
69 errcnt++; 69 errcnt++;
@@ -79,7 +79,7 @@ il4965_verify_inst_sparse(struct il_priv *priv, __le32 *image, u32 len)
79 * il4965_verify_inst_full - verify runtime uCode image in card vs. host, 79 * il4965_verify_inst_full - verify runtime uCode image in card vs. host,
80 * looking at all data. 80 * looking at all data.
81 */ 81 */
82static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image, 82static int il4965_verify_inst_full(struct il_priv *il, __le32 *image,
83 u32 len) 83 u32 len)
84{ 84{
85 u32 val; 85 u32 val;
@@ -87,9 +87,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
87 int ret = 0; 87 int ret = 0;
88 u32 errcnt; 88 u32 errcnt;
89 89
90 IL_DEBUG_INFO(priv, "ucode inst image size is %u\n", len); 90 IL_DEBUG_INFO(il, "ucode inst image size is %u\n", len);
91 91
92 il_write_direct32(priv, HBUS_TARG_MEM_RADDR, 92 il_write_direct32(il, HBUS_TARG_MEM_RADDR,
93 IWL4965_RTC_INST_LOWER_BOUND); 93 IWL4965_RTC_INST_LOWER_BOUND);
94 94
95 errcnt = 0; 95 errcnt = 0;
@@ -97,9 +97,9 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
97 /* read data comes through single port, auto-incr addr */ 97 /* read data comes through single port, auto-incr addr */
98 /* NOTE: Use the debugless read so we don't flood kernel log 98 /* NOTE: Use the debugless read so we don't flood kernel log
99 * if IL_DL_IO is set */ 99 * if IL_DL_IO is set */
100 val = _il_read_direct32(priv, HBUS_TARG_MEM_RDAT); 100 val = _il_read_direct32(il, HBUS_TARG_MEM_RDAT);
101 if (val != le32_to_cpu(*image)) { 101 if (val != le32_to_cpu(*image)) {
102 IL_ERR(priv, "uCode INST section is invalid at " 102 IL_ERR(il, "uCode INST section is invalid at "
103 "offset 0x%x, is 0x%x, s/b 0x%x\n", 103 "offset 0x%x, is 0x%x, s/b 0x%x\n",
104 save_len - len, val, le32_to_cpu(*image)); 104 save_len - len, val, le32_to_cpu(*image));
105 ret = -EIO; 105 ret = -EIO;
@@ -110,7 +110,7 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
110 } 110 }
111 111
112 if (!errcnt) 112 if (!errcnt)
113 IL_DEBUG_INFO(priv, 113 IL_DEBUG_INFO(il,
114 "ucode image in INSTRUCTION memory is good\n"); 114 "ucode image in INSTRUCTION memory is good\n");
115 115
116 return ret; 116 return ret;
@@ -120,47 +120,47 @@ static int il4965_verify_inst_full(struct il_priv *priv, __le32 *image,
120 * il4965_verify_ucode - determine which instruction image is in SRAM, 120 * il4965_verify_ucode - determine which instruction image is in SRAM,
121 * and verify its contents 121 * and verify its contents
122 */ 122 */
123int il4965_verify_ucode(struct il_priv *priv) 123int il4965_verify_ucode(struct il_priv *il)
124{ 124{
125 __le32 *image; 125 __le32 *image;
126 u32 len; 126 u32 len;
127 int ret; 127 int ret;
128 128
129 /* Try bootstrap */ 129 /* Try bootstrap */
130 image = (__le32 *)priv->ucode_boot.v_addr; 130 image = (__le32 *)il->ucode_boot.v_addr;
131 len = priv->ucode_boot.len; 131 len = il->ucode_boot.len;
132 ret = il4965_verify_inst_sparse(priv, image, len); 132 ret = il4965_verify_inst_sparse(il, image, len);
133 if (!ret) { 133 if (!ret) {
134 IL_DEBUG_INFO(priv, "Bootstrap uCode is good in inst SRAM\n"); 134 IL_DEBUG_INFO(il, "Bootstrap uCode is good in inst SRAM\n");
135 return 0; 135 return 0;
136 } 136 }
137 137
138 /* Try initialize */ 138 /* Try initialize */
139 image = (__le32 *)priv->ucode_init.v_addr; 139 image = (__le32 *)il->ucode_init.v_addr;
140 len = priv->ucode_init.len; 140 len = il->ucode_init.len;
141 ret = il4965_verify_inst_sparse(priv, image, len); 141 ret = il4965_verify_inst_sparse(il, image, len);
142 if (!ret) { 142 if (!ret) {
143 IL_DEBUG_INFO(priv, "Initialize uCode is good in inst SRAM\n"); 143 IL_DEBUG_INFO(il, "Initialize uCode is good in inst SRAM\n");
144 return 0; 144 return 0;
145 } 145 }
146 146
147 /* Try runtime/protocol */ 147 /* Try runtime/protocol */
148 image = (__le32 *)priv->ucode_code.v_addr; 148 image = (__le32 *)il->ucode_code.v_addr;
149 len = priv->ucode_code.len; 149 len = il->ucode_code.len;
150 ret = il4965_verify_inst_sparse(priv, image, len); 150 ret = il4965_verify_inst_sparse(il, image, len);
151 if (!ret) { 151 if (!ret) {
152 IL_DEBUG_INFO(priv, "Runtime uCode is good in inst SRAM\n"); 152 IL_DEBUG_INFO(il, "Runtime uCode is good in inst SRAM\n");
153 return 0; 153 return 0;
154 } 154 }
155 155
156 IL_ERR(priv, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n"); 156 IL_ERR(il, "NO VALID UCODE IMAGE IN INSTRUCTION SRAM!!\n");
157 157
158 /* Since nothing seems to match, show first several data entries in 158 /* Since nothing seems to match, show first several data entries in
159 * instruction SRAM, so maybe visual inspection will give a clue. 159 * instruction SRAM, so maybe visual inspection will give a clue.
160 * Selection of bootstrap image (vs. other images) is arbitrary. */ 160 * Selection of bootstrap image (vs. other images) is arbitrary. */
161 image = (__le32 *)priv->ucode_boot.v_addr; 161 image = (__le32 *)il->ucode_boot.v_addr;
162 len = priv->ucode_boot.len; 162 len = il->ucode_boot.len;
163 ret = il4965_verify_inst_full(priv, image, len); 163 ret = il4965_verify_inst_full(il, image, len);
164 164
165 return ret; 165 return ret;
166} 166}