41 u16 frag_length, frag_offset = 0;
46 unsigned char *seg_ptr;
53 if ((buffer_len - frag_offset) > frag_threshold) {
58 frag_length = buffer_len - frag_offset;
63 skb = dev_alloc_skb(frag_length + 4);
64 memcpy((
unsigned char *)(skb->cb), &dev,
sizeof(dev));
71 for (i = 0; i < frag_length; i += 4) {
72 *seg_ptr++ = ((i+0) < frag_length) ?
73 code_virtual_address[i+3] : 0;
74 *seg_ptr++ = ((i+1) < frag_length) ?
75 code_virtual_address[i+2] : 0;
76 *seg_ptr++ = ((i+2) < frag_length) ?
77 code_virtual_address[i+1] : 0;
78 *seg_ptr++ = ((i+3) < frag_length) ?
79 code_virtual_address[i+0] : 0;
86 (priv->
rtllib->queue_stop)) {
92 priv->
rtllib->softmac_hard_start_xmit(skb, dev);
95 code_virtual_address += frag_length;
96 frag_offset += frag_length;
98 }
while (frag_offset < buffer_len);
107 bool rt_status =
true;
121 goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
140 goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
146 CPUCheckMainCodeOKAndTurnOnCPU_Fail:
155 bool rt_status =
true;
157 unsigned long timeout;
168 goto CPUCheckFirmwareReady_Fail;
174 CPUCheckFirmwareReady_Fail:
181 static bool firmware_check_ready(
struct net_device *dev,
186 bool rt_status =
true;
188 switch (load_fw_status) {
214 "(%d)!\n", rt_status);
229 bool rt_status =
true;
257 " firmware state\n");
276 fw_name[init_step], &priv->
pdev->dev);
280 goto download_firmware_fail;
285 "exceed the container struct "
287 goto download_firmware_fail;
302 fw_entry->
size + 128;
313 mapped_file = firmware_img_buf[init_step];
314 file_length = firmware_img_len[init_step];
332 if (rt_status !=
true) {
333 goto download_firmware_fail;
336 if (!firmware_check_ready(dev, init_step)) {
337 goto download_firmware_fail;
344 download_firmware_fail: