Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Drivers: Staging: ft1000: Fixed C99 // comments styling issue

This patch removes C99 style comments from the driver and whenever
possible attempts to match coding style of the rest of the driver.

Signed-off-by: Daniel Dodge <danieldodgese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Daniel Dodge and committed by
Greg Kroah-Hartman
588c31ea 9b89b049

+455 -425
+26 -26
drivers/staging/ft1000/ft1000-pcmcia/boot.h
··· 1 - //--------------------------------------------------------------------------- 2 - // FT1000 driver for Flarion Flash OFDM NIC Device 3 - // 4 - // Copyright (C) 2002 Flarion Technologies, All rights reserved. 5 - // 6 - // This program is free software; you can redistribute it and/or modify it 7 - // under the terms of the GNU General Public License as published by the Free 8 - // Software Foundation; either version 2 of the License, or (at your option) any 9 - // later version. This program is distributed in the hope that it will be useful, 10 - // but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 - // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 - // more details. You should have received a copy of the GNU General Public 13 - // License along with this program; if not, write to the 14 - // Free Software Foundation, Inc., 59 Temple Place - 15 - // Suite 330, Boston, MA 02111-1307, USA. 16 - //--------------------------------------------------------------------------- 17 - // 18 - // File: boot.h 19 - // 20 - // Description: boatloader 21 - // 22 - // History: 23 - // 1/11/05 Whc Ported to Linux. 24 - // 25 - //--------------------------------------------------------------------------- 1 + /*--------------------------------------------------------------------------- 2 + FT1000 driver for Flarion Flash OFDM NIC Device 3 + 4 + Copyright (C) 2002 Flarion Technologies, All rights reserved. 5 + 6 + This program is free software; you can redistribute it and/or modify it 7 + under the terms of the GNU General Public License as published by the Free 8 + Software Foundation; either version 2 of the License, or (at your option) any 9 + later version. This program is distributed in the hope that it will be useful, 10 + but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 + more details. You should have received a copy of the GNU General Public 13 + License along with this program; if not, write to the 14 + Free Software Foundation, Inc., 59 Temple Place - 15 + Suite 330, Boston, MA 02111-1307, USA. 16 + --------------------------------------------------------------------------- 17 + 18 + File: boot.h 19 + 20 + Description: boatloader 21 + 22 + History: 23 + 1/11/05 Whc Ported to Linux. 24 + 25 + ---------------------------------------------------------------------------*/ 26 26 #ifndef _BOOTH_ 27 27 #define _BOOTH_ 28 28 29 - // Official bootloader 29 + /* Official bootloader */ 30 30 static unsigned char bootimage[] = { 31 31 0x00, 0x00, 0x01, 0x5E, 0x00, 0x00, 32 32 0x00, 0x00, 0x00, 0x00, 0x02, 0xD7,
+398 -368
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
··· 15 15 License along with this program; if not, write to the 16 16 Free Software Foundation, Inc., 59 Temple Place - 17 17 Suite 330, Boston, MA 02111-1307, USA. 18 - -----------------------------------------------------------------------------*/ 18 + -------------------------------------------------------------------------*/ 19 19 20 20 #include <linux/kernel.h> 21 21 #include <linux/module.h> ··· 80 80 81 81 #define MAX_RCV_LOOP 100 82 82 83 - //--------------------------------------------------------------------------- 84 - // 85 - // Function: ft1000_read_fifo_len 86 - // Description: This function will read the ASIC Uplink FIFO status register 87 - // which will return the number of bytes remaining in the Uplink FIFO. 88 - // Sixteen bytes are subtracted to make sure that the ASIC does not 89 - // reach its threshold. 90 - // Input: 91 - // dev - network device structure 92 - // Output: 93 - // value - number of bytes available in the ASIC Uplink FIFO. 94 - // 95 - //--------------------------------------------------------------------------- 83 + /*--------------------------------------------------------------------------- 84 + 85 + Function: ft1000_read_fifo_len 86 + Description: This function will read the ASIC Uplink FIFO status register 87 + which will return the number of bytes remaining in the Uplink FIFO. 88 + Sixteen bytes are subtracted to make sure that the ASIC does not 89 + reach its threshold. 90 + Input: 91 + dev - network device structure 92 + Output: 93 + value - number of bytes available in the ASIC Uplink FIFO. 94 + 95 + -------------------------------------------------------------------------*/ 96 96 static inline u16 ft1000_read_fifo_len(struct net_device *dev) 97 97 { 98 98 struct ft1000_info *info = netdev_priv(dev); ··· 103 103 return (ft1000_read_reg(dev, FT1000_REG_MAG_UFSR) - 16); 104 104 } 105 105 106 - //--------------------------------------------------------------------------- 107 - // 108 - // Function: ft1000_read_dpram 109 - // Description: This function will read the specific area of dpram 110 - // (Electrabuzz ASIC only) 111 - // Input: 112 - // dev - device structure 113 - // offset - index of dpram 114 - // Output: 115 - // value - value of dpram 116 - // 117 - //--------------------------------------------------------------------------- 106 + /*--------------------------------------------------------------------------- 107 + 108 + Function: ft1000_read_dpram 109 + Description: This function will read the specific area of dpram 110 + (Electrabuzz ASIC only) 111 + Input: 112 + dev - device structure 113 + offset - index of dpram 114 + Output: 115 + value - value of dpram 116 + 117 + -------------------------------------------------------------------------*/ 118 118 u16 ft1000_read_dpram(struct net_device *dev, int offset) 119 119 { 120 120 struct ft1000_info *info = netdev_priv(dev); 121 121 unsigned long flags; 122 122 u16 data; 123 123 124 - // Provide mutual exclusive access while reading ASIC registers. 124 + /* Provide mutual exclusive access while reading ASIC registers. */ 125 125 spin_lock_irqsave(&info->dpram_lock, flags); 126 126 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 127 127 data = ft1000_read_reg(dev, FT1000_REG_DPRAM_DATA); ··· 130 130 return (data); 131 131 } 132 132 133 - //--------------------------------------------------------------------------- 134 - // 135 - // Function: ft1000_write_dpram 136 - // Description: This function will write to a specific area of dpram 137 - // (Electrabuzz ASIC only) 138 - // Input: 139 - // dev - device structure 140 - // offset - index of dpram 141 - // value - value to write 142 - // Output: 143 - // none. 144 - // 145 - //--------------------------------------------------------------------------- 133 + /*--------------------------------------------------------------------------- 134 + 135 + Function: ft1000_write_dpram 136 + Description: This function will write to a specific area of dpram 137 + (Electrabuzz ASIC only) 138 + Input: 139 + dev - device structure 140 + offset - index of dpram 141 + value - value to write 142 + Output: 143 + none. 144 + 145 + -------------------------------------------------------------------------*/ 146 146 static inline void ft1000_write_dpram(struct net_device *dev, 147 147 int offset, u16 value) 148 148 { 149 149 struct ft1000_info *info = netdev_priv(dev); 150 150 unsigned long flags; 151 151 152 - // Provide mutual exclusive access while reading ASIC registers. 152 + /* Provide mutual exclusive access while reading ASIC registers. */ 153 153 spin_lock_irqsave(&info->dpram_lock, flags); 154 154 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 155 155 ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, value); 156 156 spin_unlock_irqrestore(&info->dpram_lock, flags); 157 157 } 158 158 159 - //--------------------------------------------------------------------------- 160 - // 161 - // Function: ft1000_read_dpram_mag_16 162 - // Description: This function will read the specific area of dpram 163 - // (Magnemite ASIC only) 164 - // Input: 165 - // dev - device structure 166 - // offset - index of dpram 167 - // Output: 168 - // value - value of dpram 169 - // 170 - //--------------------------------------------------------------------------- 159 + /*--------------------------------------------------------------------------- 160 + 161 + Function: ft1000_read_dpram_mag_16 162 + Description: This function will read the specific area of dpram 163 + (Magnemite ASIC only) 164 + Input: 165 + dev - device structure 166 + offset - index of dpram 167 + Output: 168 + value - value of dpram 169 + 170 + -------------------------------------------------------------------------*/ 171 171 u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index) 172 172 { 173 173 struct ft1000_info *info = netdev_priv(dev); 174 174 unsigned long flags; 175 175 u16 data; 176 176 177 - // Provide mutual exclusive access while reading ASIC registers. 177 + /* Provide mutual exclusive access while reading ASIC registers. */ 178 178 spin_lock_irqsave(&info->dpram_lock, flags); 179 179 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 180 - // check if we want to read upper or lower 32-bit word 180 + /* check if we want to read upper or lower 32-bit word */ 181 181 if (Index) { 182 182 data = ft1000_read_reg(dev, FT1000_REG_MAG_DPDATAL); 183 183 } else { ··· 188 188 return (data); 189 189 } 190 190 191 - //--------------------------------------------------------------------------- 192 - // 193 - // Function: ft1000_write_dpram_mag_16 194 - // Description: This function will write to a specific area of dpram 195 - // (Magnemite ASIC only) 196 - // Input: 197 - // dev - device structure 198 - // offset - index of dpram 199 - // value - value to write 200 - // Output: 201 - // none. 202 - // 203 - //--------------------------------------------------------------------------- 191 + /*--------------------------------------------------------------------------- 192 + 193 + Function: ft1000_write_dpram_mag_16 194 + Description: This function will write to a specific area of dpram 195 + (Magnemite ASIC only) 196 + Input: 197 + dev - device structure 198 + offset - index of dpram 199 + value - value to write 200 + Output: 201 + none. 202 + 203 + -------------------------------------------------------------------------*/ 204 204 static inline void ft1000_write_dpram_mag_16(struct net_device *dev, 205 205 int offset, u16 value, int Index) 206 206 { 207 207 struct ft1000_info *info = netdev_priv(dev); 208 208 unsigned long flags; 209 209 210 - // Provide mutual exclusive access while reading ASIC registers. 210 + /* Provide mutual exclusive access while reading ASIC registers. */ 211 211 spin_lock_irqsave(&info->dpram_lock, flags); 212 212 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 213 213 if (Index) { ··· 218 218 spin_unlock_irqrestore(&info->dpram_lock, flags); 219 219 } 220 220 221 - //--------------------------------------------------------------------------- 222 - // 223 - // Function: ft1000_read_dpram_mag_32 224 - // Description: This function will read the specific area of dpram 225 - // (Magnemite ASIC only) 226 - // Input: 227 - // dev - device structure 228 - // offset - index of dpram 229 - // Output: 230 - // value - value of dpram 231 - // 232 - //--------------------------------------------------------------------------- 221 + /*--------------------------------------------------------------------------- 222 + 223 + Function: ft1000_read_dpram_mag_32 224 + Description: This function will read the specific area of dpram 225 + (Magnemite ASIC only) 226 + Input: 227 + dev - device structure 228 + offset - index of dpram 229 + Output: 230 + value - value of dpram 231 + 232 + -------------------------------------------------------------------------*/ 233 233 u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset) 234 234 { 235 235 struct ft1000_info *info = netdev_priv(dev); 236 236 unsigned long flags; 237 237 u32 data; 238 238 239 - // Provide mutual exclusive access while reading ASIC registers. 239 + /* Provide mutual exclusive access while reading ASIC registers. */ 240 240 spin_lock_irqsave(&info->dpram_lock, flags); 241 241 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 242 242 data = inl(dev->base_addr + FT1000_REG_MAG_DPDATAL); ··· 245 245 return (data); 246 246 } 247 247 248 - //--------------------------------------------------------------------------- 249 - // 250 - // Function: ft1000_write_dpram_mag_32 251 - // Description: This function will write to a specific area of dpram 252 - // (Magnemite ASIC only) 253 - // Input: 254 - // dev - device structure 255 - // offset - index of dpram 256 - // value - value to write 257 - // Output: 258 - // none. 259 - // 260 - //--------------------------------------------------------------------------- 248 + /*--------------------------------------------------------------------------- 249 + 250 + Function: ft1000_write_dpram_mag_32 251 + Description: This function will write to a specific area of dpram 252 + (Magnemite ASIC only) 253 + Input: 254 + dev - device structure 255 + offset - index of dpram 256 + value - value to write 257 + Output: 258 + none. 259 + 260 + -------------------------------------------------------------------------*/ 261 261 void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value) 262 262 { 263 263 struct ft1000_info *info = netdev_priv(dev); 264 264 unsigned long flags; 265 265 266 - // Provide mutual exclusive access while reading ASIC registers. 266 + /* Provide mutual exclusive access while reading ASIC registers. */ 267 267 spin_lock_irqsave(&info->dpram_lock, flags); 268 268 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); 269 269 outl(value, dev->base_addr + FT1000_REG_MAG_DPDATAL); 270 270 spin_unlock_irqrestore(&info->dpram_lock, flags); 271 271 } 272 272 273 - //--------------------------------------------------------------------------- 274 - // 275 - // Function: ft1000_enable_interrupts 276 - // Description: This function will enable interrupts base on the current interrupt mask. 277 - // Input: 278 - // dev - device structure 279 - // Output: 280 - // None. 281 - // 282 - //--------------------------------------------------------------------------- 273 + /*--------------------------------------------------------------------------- 274 + 275 + Function: ft1000_enable_interrupts 276 + Description: This function will enable interrupts base on the current interrupt mask. 277 + Input: 278 + dev - device structure 279 + Output: 280 + None. 281 + 282 + -------------------------------------------------------------------------*/ 283 283 static void ft1000_enable_interrupts(struct net_device *dev) 284 284 { 285 285 u16 tempword; ··· 292 292 tempword); 293 293 } 294 294 295 - //--------------------------------------------------------------------------- 296 - // 297 - // Function: ft1000_disable_interrupts 298 - // Description: This function will disable all interrupts. 299 - // Input: 300 - // dev - device structure 301 - // Output: 302 - // None. 303 - // 304 - //--------------------------------------------------------------------------- 295 + /*--------------------------------------------------------------------------- 296 + 297 + Function: ft1000_disable_interrupts 298 + Description: This function will disable all interrupts. 299 + Input: 300 + dev - device structure 301 + Output: 302 + None. 303 + 304 + -------------------------------------------------------------------------*/ 305 305 static void ft1000_disable_interrupts(struct net_device *dev) 306 306 { 307 307 u16 tempword; ··· 314 314 tempword); 315 315 } 316 316 317 - //--------------------------------------------------------------------------- 318 - // 319 - // Function: ft1000_reset_asic 320 - // Description: This function will call the Card Service function to reset the 321 - // ASIC. 322 - // Input: 323 - // dev - device structure 324 - // Output: 325 - // none 326 - // 327 - //--------------------------------------------------------------------------- 317 + /*--------------------------------------------------------------------------- 318 + 319 + Function: ft1000_reset_asic 320 + Description: This function will call the Card Service function to reset the 321 + ASIC. 322 + Input: 323 + dev - device structure 324 + Output: 325 + none 326 + 327 + -------------------------------------------------------------------------*/ 328 328 static void ft1000_reset_asic(struct net_device *dev) 329 329 { 330 330 struct ft1000_info *info = netdev_priv(dev); ··· 335 335 336 336 (*info->ft1000_reset) (pcmcia->link); 337 337 338 - // Let's use the register provided by the Magnemite ASIC to reset the 339 - // ASIC and DSP. 338 + /* 339 + * Let's use the register provided by the Magnemite ASIC to reset the 340 + * ASIC and DSP. 341 + */ 340 342 if (info->AsicID == MAGNEMITE_ID) { 341 343 ft1000_write_reg(dev, FT1000_REG_RESET, 342 344 (DSP_RESET_BIT | ASIC_RESET_BIT)); 343 345 } 344 346 mdelay(1); 345 347 if (info->AsicID == ELECTRABUZZ_ID) { 346 - // set watermark to -1 in order to not generate an interrupt 348 + /* set watermark to -1 in order to not generate an interrupt */ 347 349 ft1000_write_reg(dev, FT1000_REG_WATERMARK, 0xffff); 348 350 } else { 349 - // set watermark to -1 in order to not generate an interrupt 351 + /* set watermark to -1 in order to not generate an interrupt */ 350 352 ft1000_write_reg(dev, FT1000_REG_MAG_WATERMARK, 0xffff); 351 353 } 352 - // clear interrupts 354 + /* clear interrupts */ 353 355 tempword = ft1000_read_reg(dev, FT1000_REG_SUP_ISR); 354 356 DEBUG(1, "ft1000_hw: interrupt status register = 0x%x\n", tempword); 355 357 ft1000_write_reg(dev, FT1000_REG_SUP_ISR, tempword); ··· 360 358 361 359 } 362 360 363 - //--------------------------------------------------------------------------- 364 - // 365 - // Function: ft1000_reset_card 366 - // Description: This function will reset the card 367 - // Input: 368 - // dev - device structure 369 - // Output: 370 - // status - false (card reset fail) 371 - // true (card reset successful) 372 - // 373 - //--------------------------------------------------------------------------- 361 + /*--------------------------------------------------------------------------- 362 + 363 + Function: ft1000_reset_card 364 + Description: This function will reset the card 365 + Input: 366 + dev - device structure 367 + Output: 368 + status - false (card reset fail) 369 + true (card reset successful) 370 + 371 + -------------------------------------------------------------------------*/ 374 372 static int ft1000_reset_card(struct net_device *dev) 375 373 { 376 374 struct ft1000_info *info = netdev_priv(dev); ··· 386 384 info->squeseqnum = 0; 387 385 ft1000_disable_interrupts(dev); 388 386 389 - // del_timer(&poll_timer); 387 + /* del_timer(&poll_timer); */ 390 388 391 - // Make sure we free any memory reserve for provisioning 389 + /* Make sure we free any memory reserve for provisioning */ 392 390 while (list_empty(&info->prov_list) == 0) { 393 391 DEBUG(0, 394 392 "ft1000_hw:ft1000_reset_card:deleting provisioning record\n"); ··· 408 406 (DSP_RESET_BIT | ASIC_RESET_BIT)); 409 407 } 410 408 411 - // Copy DSP session record into info block if this is not a coldstart 409 + /* Copy DSP session record into info block if this is not a coldstart */ 412 410 if (ft1000_card_present == 1) { 413 411 spin_lock_irqsave(&info->dpram_lock, flags); 414 412 if (info->AsicID == ELECTRABUZZ_ID) { ··· 432 430 433 431 DEBUG(1, "ft1000_hw:ft1000_reset_card:resetting ASIC\n"); 434 432 mdelay(10); 435 - //reset ASIC 433 + /* reset ASIC */ 436 434 ft1000_reset_asic(dev); 437 435 438 436 DEBUG(1, "ft1000_hw:ft1000_reset_card:downloading dsp image\n"); 439 437 440 438 if (info->AsicID == MAGNEMITE_ID) { 441 - // Put dsp in reset and take ASIC out of reset 439 + /* Put dsp in reset and take ASIC out of reset */ 442 440 DEBUG(0, 443 441 "ft1000_hw:ft1000_reset_card:Put DSP in reset and take ASIC out of reset\n"); 444 442 ft1000_write_reg(dev, FT1000_REG_RESET, DSP_RESET_BIT); 445 443 446 - // Setting MAGNEMITE ASIC to big endian mode 444 + /* Setting MAGNEMITE ASIC to big endian mode */ 447 445 ft1000_write_reg(dev, FT1000_REG_SUP_CTRL, HOST_INTF_BE); 448 - // Download bootloader 446 + /* Download bootloader */ 449 447 card_bootload(dev); 450 448 451 - // Take DSP out of reset 449 + /* Take DSP out of reset */ 452 450 ft1000_write_reg(dev, FT1000_REG_RESET, 0); 453 - // FLARION_DSP_ACTIVE; 451 + /* FLARION_DSP_ACTIVE; */ 454 452 mdelay(10); 455 453 DEBUG(0, "ft1000_hw:ft1000_reset_card:Take DSP out of reset\n"); 456 454 457 - // Wait for 0xfefe indicating dsp ready before starting download 455 + /* Wait for 0xfefe indicating dsp ready before starting download */ 458 456 for (i = 0; i < 50; i++) { 459 457 tempword = 460 458 ft1000_read_dpram_mag_16(dev, FT1000_MAG_DPRAM_FEFE, ··· 472 470 } 473 471 474 472 } else { 475 - // Take DSP out of reset 473 + /* Take DSP out of reset */ 476 474 ft1000_write_reg(dev, FT1000_REG_RESET, ~DSP_RESET_BIT); 477 475 mdelay(10); 478 476 } ··· 487 485 mdelay(10); 488 486 489 487 if (info->AsicID == ELECTRABUZZ_ID) { 490 - // Need to initialize the FIFO length counter to zero in order to sync up 491 - // with the DSP 488 + /* 489 + * Need to initialize the FIFO length counter to zero in order to sync up 490 + * with the DSP 491 + */ 492 492 info->fifo_cnt = 0; 493 493 ft1000_write_dpram(dev, FT1000_FIFO_LEN, info->fifo_cnt); 494 - // Initialize DSP heartbeat area to ho 494 + /* Initialize DSP heartbeat area to ho */ 495 495 ft1000_write_dpram(dev, FT1000_HI_HO, ho); 496 496 tempword = ft1000_read_dpram(dev, FT1000_HI_HO); 497 497 DEBUG(1, "ft1000_hw:ft1000_reset_asic:hi_ho value = 0x%x\n", 498 498 tempword); 499 499 } else { 500 - // Initialize DSP heartbeat area to ho 500 + /* Initialize DSP heartbeat area to ho */ 501 501 ft1000_write_dpram_mag_16(dev, FT1000_MAG_HI_HO, ho_mag, 502 502 FT1000_MAG_HI_HO_INDX); 503 503 tempword = ··· 513 509 ft1000_enable_interrupts(dev); 514 510 515 511 /* Schedule heartbeat process to run every 2 seconds */ 516 - // poll_timer.expires = jiffies + (2*HZ); 517 - // poll_timer.data = (u_long)dev; 518 - // add_timer(&poll_timer); 512 + /* poll_timer.expires = jiffies + (2*HZ); */ 513 + /* poll_timer.data = (u_long)dev; */ 514 + /* add_timer(&poll_timer); */ 519 515 520 516 return true; 521 517 522 518 } 523 519 524 - //--------------------------------------------------------------------------- 525 - // 526 - // Function: ft1000_chkcard 527 - // Description: This function will check if the device is presently available on 528 - // the system. 529 - // Input: 530 - // dev - device structure 531 - // Output: 532 - // status - false (device is not present) 533 - // true (device is present) 534 - // 535 - //--------------------------------------------------------------------------- 520 + /*--------------------------------------------------------------------------- 521 + 522 + Function: ft1000_chkcard 523 + Description: This function will check if the device is presently available on 524 + the system. 525 + Input: 526 + dev - device structure 527 + Output: 528 + status - false (device is not present) 529 + true (device is present) 530 + 531 + -------------------------------------------------------------------------*/ 536 532 static int ft1000_chkcard(struct net_device *dev) 537 533 { 538 534 u16 tempword; 539 535 540 - // Mask register is used to check for device presence since it is never 541 - // set to zero. 536 + /* 537 + * Mask register is used to check for device presence since it is never 538 + * set to zero. 539 + */ 542 540 tempword = ft1000_read_reg(dev, FT1000_REG_SUP_IMASK); 543 541 if (tempword == 0) { 544 542 DEBUG(1, 545 543 "ft1000_hw:ft1000_chkcard: IMASK = 0 Card not detected\n"); 546 544 return false; 547 545 } 548 - // The system will return the value of 0xffff for the version register 549 - // if the device is not present. 546 + /* 547 + * The system will return the value of 0xffff for the version register 548 + * if the device is not present. 549 + */ 550 550 tempword = ft1000_read_reg(dev, FT1000_REG_ASIC_ID); 551 551 if (tempword == 0xffff) { 552 552 DEBUG(1, ··· 561 553 } 562 554 563 555 564 - //--------------------------------------------------------------------------- 565 - // 566 - // Function: ft1000_hbchk 567 - // Description: This function will perform the heart beat check of the DSP as 568 - // well as the ASIC. 569 - // Input: 570 - // dev - device structure 571 - // Output: 572 - // none 573 - // 574 - //--------------------------------------------------------------------------- 556 + /*--------------------------------------------------------------------------- 557 + 558 + Function: ft1000_hbchk 559 + Description: This function will perform the heart beat check of the DSP as 560 + well as the ASIC. 561 + Input: 562 + dev - device structure 563 + Output: 564 + none 565 + 566 + -------------------------------------------------------------------------*/ 575 567 static void ft1000_hbchk(u_long data) 576 568 { 577 569 struct net_device *dev = (struct net_device *)data; ··· 582 574 info = netdev_priv(dev); 583 575 584 576 if (info->CardReady == 1) { 585 - // Perform dsp heartbeat check 577 + /* Perform dsp heartbeat check */ 586 578 if (info->AsicID == ELECTRABUZZ_ID) { 587 579 tempword = ft1000_read_dpram(dev, FT1000_HI_HO); 588 580 } else { ··· 593 585 } 594 586 DEBUG(1, "ft1000_hw:ft1000_hbchk:hi_ho value = 0x%x\n", 595 587 tempword); 596 - // Let's perform another check if ho is not detected 588 + /* Let's perform another check if ho is not detected */ 597 589 if (tempword != ho) { 598 590 if (info->AsicID == ELECTRABUZZ_ID) { 599 591 tempword = ft1000_read_dpram(dev, FT1000_HI_HO); ··· 647 639 } 648 640 649 641 tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); 650 - // Let's check doorbell again if fail 642 + /* Let's check doorbell again if fail */ 651 643 if (tempword & FT1000_DB_HB) { 652 644 tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); 653 645 } ··· 694 686 add_timer(&poll_timer); 695 687 return; 696 688 } 697 - // Set dedicated area to hi and ring appropriate doorbell according 698 - // to hi/ho heartbeat protocol 689 + /* 690 + * Set dedicated area to hi and ring appropriate doorbell according 691 + * to hi/ho heartbeat protocol 692 + */ 699 693 if (info->AsicID == ELECTRABUZZ_ID) { 700 694 ft1000_write_dpram(dev, FT1000_HI_HO, hi); 701 695 } else { ··· 713 703 (dev, FT1000_MAG_HI_HO, 714 704 FT1000_MAG_HI_HO_INDX)); 715 705 } 716 - // Let's write hi again if fail 706 + /* Let's write hi again if fail */ 717 707 if (tempword != hi) { 718 708 if (info->AsicID == ELECTRABUZZ_ID) { 719 709 ft1000_write_dpram(dev, FT1000_HI_HO, hi); ··· 784 774 add_timer(&poll_timer); 785 775 } 786 776 787 - //--------------------------------------------------------------------------- 788 - // 789 - // Function: ft1000_send_cmd 790 - // Description: 791 - // Input: 792 - // Output: 793 - // 794 - //--------------------------------------------------------------------------- 777 + /*--------------------------------------------------------------------------- 778 + 779 + Function: ft1000_send_cmd 780 + Description: 781 + Input: 782 + Output: 783 + 784 + -------------------------------------------------------------------------*/ 795 785 static void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype) 796 786 { 797 787 struct ft1000_info *info = netdev_priv(dev); ··· 800 790 unsigned long flags; 801 791 802 792 size += sizeof(struct pseudo_hdr); 803 - // check for odd byte and increment to 16-bit word align value 793 + /* check for odd byte and increment to 16-bit word align value */ 804 794 if ((size & 0x0001)) { 805 795 size++; 806 796 } 807 797 DEBUG(1, "FT1000:ft1000_send_cmd:total length = %d\n", size); 808 798 DEBUG(1, "FT1000:ft1000_send_cmd:length = %d\n", ntohs(*ptempbuffer)); 809 - // put message into slow queue area 810 - // All messages are in the form total_len + pseudo header + message body 799 + /* 800 + * put message into slow queue area 801 + * All messages are in the form total_len + pseudo header + message body 802 + */ 811 803 spin_lock_irqsave(&info->dpram_lock, flags); 812 804 813 - // Make sure SLOWQ doorbell is clear 805 + /* Make sure SLOWQ doorbell is clear */ 814 806 tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); 815 807 i=0; 816 808 while (tempword & FT1000_DB_DPRAM_TX) { ··· 828 816 if (info->AsicID == ELECTRABUZZ_ID) { 829 817 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, 830 818 FT1000_DPRAM_TX_BASE); 831 - // Write total length to dpram 819 + /* Write total length to dpram */ 832 820 ft1000_write_reg(dev, FT1000_REG_DPRAM_DATA, size); 833 - // Write pseudo header and messgae body 821 + /* Write pseudo header and messgae body */ 834 822 for (i = 0; i < (size >> 1); i++) { 835 823 DEBUG(1, "FT1000:ft1000_send_cmd:data %d = 0x%x\n", i, 836 824 *ptempbuffer); ··· 840 828 } else { 841 829 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, 842 830 FT1000_DPRAM_MAG_TX_BASE); 843 - // Write total length to dpram 831 + /* Write total length to dpram */ 844 832 ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAH, htons(size)); 845 - // Write pseudo header and messgae body 833 + /* Write pseudo header and messgae body */ 846 834 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, 847 835 FT1000_DPRAM_MAG_TX_BASE + 1); 848 836 for (i = 0; i < (size >> 2); i++) { ··· 862 850 } 863 851 spin_unlock_irqrestore(&info->dpram_lock, flags); 864 852 865 - // ring doorbell to notify DSP that we have a message ready 853 + /* ring doorbell to notify DSP that we have a message ready */ 866 854 ft1000_write_reg(dev, FT1000_REG_DOORBELL, FT1000_DB_DPRAM_TX); 867 855 } 868 856 869 - //--------------------------------------------------------------------------- 870 - // 871 - // Function: ft1000_receive_cmd 872 - // Description: This function will read a message from the dpram area. 873 - // Input: 874 - // dev - network device structure 875 - // pbuffer - caller supply address to buffer 876 - // pnxtph - pointer to next pseudo header 877 - // Output: 878 - // Status = 0 (unsuccessful) 879 - // = 1 (successful) 880 - // 881 - //--------------------------------------------------------------------------- 857 + /*--------------------------------------------------------------------------- 858 + 859 + Function: ft1000_receive_cmd 860 + Description: This function will read a message from the dpram area. 861 + Input: 862 + dev - network device structure 863 + pbuffer - caller supply address to buffer 864 + pnxtph - pointer to next pseudo header 865 + Output: 866 + Status = 0 (unsuccessful) 867 + = 1 (successful) 868 + 869 + -------------------------------------------------------------------------*/ 882 870 static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer, 883 871 int maxsz, u16 *pnxtph) 884 872 { ··· 931 919 FT1000_REG_MAG_DPDATAH); 932 920 pbuffer++; 933 921 } 934 - //copy odd aligned word 922 + /* copy odd aligned word */ 935 923 *pbuffer = inw(dev->base_addr + FT1000_REG_MAG_DPDATAL); 936 924 DEBUG(1, "ft1000_hw:received data = 0x%x\n", *pbuffer); 937 925 pbuffer++; ··· 940 928 pbuffer++; 941 929 } 942 930 if (size & 0x0001) { 943 - //copy odd byte from fifo 931 + /* copy odd byte from fifo */ 944 932 tempword = ft1000_read_reg(dev, FT1000_REG_DPRAM_DATA); 945 933 *pbuffer = ntohs(tempword); 946 934 } 947 935 spin_unlock_irqrestore(&info->dpram_lock, flags); 948 936 949 - // Check if pseudo header checksum is good 950 - // Calculate pseudo header checksum 937 + /* 938 + * Check if pseudo header checksum is good 939 + * Calculate pseudo header checksum 940 + */ 951 941 tempword = *ppseudohdr++; 952 942 for (i = 1; i < 7; i++) { 953 943 tempword ^= *ppseudohdr++; ··· 957 943 if ((tempword != *ppseudohdr)) { 958 944 DEBUG(1, 959 945 "FT1000:ft1000_receive_cmd:Pseudo header checksum mismatch\n"); 960 - // Drop this message 946 + /* Drop this message */ 961 947 return false; 962 948 } 963 949 return true; 964 950 } 965 951 } 966 952 967 - //--------------------------------------------------------------------------- 968 - // 969 - // Function: ft1000_proc_drvmsg 970 - // Description: This function will process the various driver messages. 971 - // Input: 972 - // dev - device structure 973 - // pnxtph - pointer to next pseudo header 974 - // Output: 975 - // none 976 - // 977 - //--------------------------------------------------------------------------- 953 + /*--------------------------------------------------------------------------- 954 + 955 + Function: ft1000_proc_drvmsg 956 + Description: This function will process the various driver messages. 957 + Input: 958 + dev - device structure 959 + pnxtph - pointer to next pseudo header 960 + Output: 961 + none 962 + 963 + -------------------------------------------------------------------------*/ 978 964 static void ft1000_proc_drvmsg(struct net_device *dev) 979 965 { 980 966 struct ft1000_info *info = netdev_priv(dev); ··· 1002 988 } 1003 989 if ( ft1000_receive_cmd(dev, &cmdbuffer[0], MAX_CMD_SQSIZE, &tempword) ) { 1004 990 1005 - // Get the message type which is total_len + PSEUDO header + msgtype + message body 991 + /* Get the message type which is total_len + PSEUDO header + msgtype + message body */ 1006 992 pdrvmsg = (struct drv_msg *) & cmdbuffer[0]; 1007 993 msgtype = ntohs(pdrvmsg->type); 1008 994 DEBUG(1, "Command message type = 0x%x\n", msgtype); ··· 1013 999 mdelay(25); 1014 1000 while (list_empty(&info->prov_list) == 0) { 1015 1001 DEBUG(0, "Sending a provisioning message\n"); 1016 - // Make sure SLOWQ doorbell is clear 1002 + /* Make sure SLOWQ doorbell is clear */ 1017 1003 tempword = 1018 1004 ft1000_read_reg(dev, FT1000_REG_DOORBELL); 1019 1005 i = 0; ··· 1032 1018 1033 1019 pmsg = (u16 *) ptr->pprov_data; 1034 1020 ppseudo_hdr = (struct pseudo_hdr *) pmsg; 1035 - // Insert slow queue sequence number 1021 + /* Insert slow queue sequence number */ 1036 1022 ppseudo_hdr->seq_num = info->squeseqnum++; 1037 1023 ppseudo_hdr->portsrc = 0; 1038 - // Calculate new checksum 1024 + /* Calculate new checksum */ 1039 1025 ppseudo_hdr->checksum = *pmsg++; 1040 1026 DEBUG(1, "checksum = 0x%x\n", 1041 1027 ppseudo_hdr->checksum); ··· 1050 1036 kfree(ptr->pprov_data); 1051 1037 kfree(ptr); 1052 1038 } 1053 - // Indicate adapter is ready to take application messages after all 1054 - // provisioning messages are sent 1039 + /* 1040 + * Indicate adapter is ready to take application messages after all 1041 + * provisioning messages are sent 1042 + */ 1055 1043 info->CardReady = 1; 1056 1044 break; 1057 1045 case MEDIA_STATE: ··· 1134 1118 break; 1135 1119 case DSP_GET_INFO: 1136 1120 DEBUG(1, "FT1000:drivermsg:Got DSP_GET_INFO\n"); 1137 - // copy dsp info block to dsp 1138 - // allow any outstanding ioctl to finish 1121 + /* 1122 + * copy dsp info block to dsp 1123 + * allow any outstanding ioctl to finish 1124 + */ 1139 1125 mdelay(10); 1140 1126 tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); 1141 1127 if (tempword & FT1000_DB_DPRAM_TX) { ··· 1150 1132 } 1151 1133 1152 1134 if ((tempword & FT1000_DB_DPRAM_TX) == 0) { 1153 - // Put message into Slow Queue 1154 - // Form Pseudo header 1135 + /* 1136 + * Put message into Slow Queue 1137 + * Form Pseudo header 1138 + */ 1155 1139 pmsg = (u16 *) info->DSPInfoBlk; 1156 1140 ppseudo_hdr = (struct pseudo_hdr *) pmsg; 1157 1141 ppseudo_hdr->length = ··· 1167 1147 ppseudo_hdr->rsvd1 = 0; 1168 1148 ppseudo_hdr->rsvd2 = 0; 1169 1149 ppseudo_hdr->qos_class = 0; 1170 - // Insert slow queue sequence number 1150 + /* Insert slow queue sequence number */ 1171 1151 ppseudo_hdr->seq_num = info->squeseqnum++; 1172 - // Insert application id 1152 + /* Insert application id */ 1173 1153 ppseudo_hdr->portsrc = 0; 1174 - // Calculate new checksum 1154 + /* Calculate new checksum */ 1175 1155 ppseudo_hdr->checksum = *pmsg++; 1176 1156 for (i = 1; i < 7; i++) { 1177 1157 ppseudo_hdr->checksum ^= *pmsg++; ··· 1185 1165 break; 1186 1166 case GET_DRV_ERR_RPT_MSG: 1187 1167 DEBUG(1, "FT1000:drivermsg:Got GET_DRV_ERR_RPT_MSG\n"); 1188 - // copy driver error message to dsp 1189 - // allow any outstanding ioctl to finish 1168 + /* 1169 + * copy driver error message to dsp 1170 + * allow any outstanding ioctl to finish 1171 + */ 1190 1172 mdelay(10); 1191 1173 tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); 1192 1174 if (tempword & FT1000_DB_DPRAM_TX) { ··· 1201 1179 } 1202 1180 1203 1181 if ((tempword & FT1000_DB_DPRAM_TX) == 0) { 1204 - // Put message into Slow Queue 1205 - // Form Pseudo header 1182 + /* 1183 + * Put message into Slow Queue 1184 + * Form Pseudo header 1185 + */ 1206 1186 pmsg = (u16 *) & tempbuffer[0]; 1207 1187 ppseudo_hdr = (struct pseudo_hdr *) pmsg; 1208 1188 ppseudo_hdr->length = htons(0x0012); ··· 1217 1193 ppseudo_hdr->rsvd1 = 0; 1218 1194 ppseudo_hdr->rsvd2 = 0; 1219 1195 ppseudo_hdr->qos_class = 0; 1220 - // Insert slow queue sequence number 1196 + /* Insert slow queue sequence number */ 1221 1197 ppseudo_hdr->seq_num = info->squeseqnum++; 1222 - // Insert application id 1198 + /* Insert application id */ 1223 1199 ppseudo_hdr->portsrc = 0; 1224 - // Calculate new checksum 1200 + /* Calculate new checksum */ 1225 1201 ppseudo_hdr->checksum = *pmsg++; 1226 1202 for (i=1; i<7; i++) { 1227 1203 ppseudo_hdr->checksum ^= *pmsg++; ··· 1252 1228 } 1253 1229 } 1254 1230 1255 - //--------------------------------------------------------------------------- 1256 - // 1257 - // Function: ft1000_parse_dpram_msg 1258 - // Description: This function will parse the message received from the DSP 1259 - // via the DPRAM interface. 1260 - // Input: 1261 - // dev - device structure 1262 - // Output: 1263 - // status - FAILURE 1264 - // SUCCESS 1265 - // 1266 - //--------------------------------------------------------------------------- 1231 + /*--------------------------------------------------------------------------- 1232 + 1233 + Function: ft1000_parse_dpram_msg 1234 + Description: This function will parse the message received from the DSP 1235 + via the DPRAM interface. 1236 + Input: 1237 + dev - device structure 1238 + Output: 1239 + status - FAILURE 1240 + SUCCESS 1241 + 1242 + -------------------------------------------------------------------------*/ 1267 1243 static int ft1000_parse_dpram_msg(struct net_device *dev) 1268 1244 { 1269 1245 struct ft1000_info *info = netdev_priv(dev); ··· 1279 1255 DEBUG(1, "Doorbell = 0x%x\n", doorbell); 1280 1256 1281 1257 if (doorbell & FT1000_ASIC_RESET_REQ) { 1282 - // Copy DSP session record from info block 1258 + /* Copy DSP session record from info block */ 1283 1259 spin_lock_irqsave(&info->dpram_lock, flags); 1284 1260 if (info->AsicID == ELECTRABUZZ_ID) { 1285 1261 ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, ··· 1298 1274 } 1299 1275 spin_unlock_irqrestore(&info->dpram_lock, flags); 1300 1276 1301 - // clear ASIC RESET request 1277 + /* clear ASIC RESET request */ 1302 1278 ft1000_write_reg(dev, FT1000_REG_DOORBELL, 1303 1279 FT1000_ASIC_RESET_REQ); 1304 1280 DEBUG(1, "Got an ASIC RESET Request\n"); ··· 1306 1282 FT1000_ASIC_RESET_DSP); 1307 1283 1308 1284 if (info->AsicID == MAGNEMITE_ID) { 1309 - // Setting MAGNEMITE ASIC to big endian mode 1285 + /* Setting MAGNEMITE ASIC to big endian mode */ 1310 1286 ft1000_write_reg(dev, FT1000_REG_SUP_CTRL, 1311 1287 HOST_INTF_BE); 1312 1288 } ··· 1339 1315 if ((total_len < MAX_CMD_SQSIZE) && (total_len > sizeof(struct pseudo_hdr))) { 1340 1316 total_len += nxtph; 1341 1317 cnt = 0; 1342 - // ft1000_read_reg will return a value that needs to be byteswap 1343 - // in order to get DSP_QID_OFFSET. 1318 + /* 1319 + * ft1000_read_reg will return a value that needs to be byteswap 1320 + * in order to get DSP_QID_OFFSET. 1321 + */ 1344 1322 if (info->AsicID == ELECTRABUZZ_ID) { 1345 1323 portid = 1346 1324 (ft1000_read_dpram ··· 1358 1332 DEBUG(1, "DSP_QID = 0x%x\n", portid); 1359 1333 1360 1334 if (portid == DRIVERID) { 1361 - // We are assumming one driver message from the DSP at a time. 1335 + /* We are assumming one driver message from the DSP at a time. */ 1362 1336 ft1000_proc_drvmsg(dev); 1363 1337 } 1364 1338 } ··· 1366 1340 } 1367 1341 1368 1342 if (doorbell & FT1000_DB_COND_RESET) { 1369 - // Reset ASIC and DSP 1343 + /* Reset ASIC and DSP */ 1370 1344 if (info->AsicID == ELECTRABUZZ_ID) { 1371 1345 info->DSP_TIME[0] = 1372 1346 ft1000_read_dpram(dev, FT1000_DSP_TIMER0); ··· 1396 1370 ft1000_write_reg(dev, FT1000_REG_DOORBELL, 1397 1371 FT1000_DB_COND_RESET); 1398 1372 } 1399 - // let's clear any unexpected doorbells from DSP 1373 + /* let's clear any unexpected doorbells from DSP */ 1400 1374 doorbell = 1401 1375 doorbell & ~(FT1000_DB_DPRAM_RX | FT1000_ASIC_RESET_REQ | 1402 1376 FT1000_DB_COND_RESET | 0xff00); ··· 1409 1383 1410 1384 } 1411 1385 1412 - //--------------------------------------------------------------------------- 1413 - // 1414 - // Function: ft1000_flush_fifo 1415 - // Description: This function will flush one packet from the downlink 1416 - // FIFO. 1417 - // Input: 1418 - // dev - device structure 1419 - // drv_err - driver error causing the flush fifo 1420 - // Output: 1421 - // None. 1422 - // 1423 - //--------------------------------------------------------------------------- 1386 + /*--------------------------------------------------------------------------- 1387 + 1388 + Function: ft1000_flush_fifo 1389 + Description: This function will flush one packet from the downlink 1390 + FIFO. 1391 + Input: 1392 + dev - device structure 1393 + drv_err - driver error causing the flush fifo 1394 + Output: 1395 + None. 1396 + 1397 + -------------------------------------------------------------------------*/ 1424 1398 static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) 1425 1399 { 1426 1400 struct ft1000_info *info = netdev_priv(dev); ··· 1458 1432 ft1000_reset_card(dev); 1459 1433 return; 1460 1434 } else { 1461 - // Flush corrupted pkt from FIFO 1435 + /* Flush corrupted pkt from FIFO */ 1462 1436 i = 0; 1463 1437 do { 1464 1438 if (info->AsicID == ELECTRABUZZ_ID) { ··· 1473 1447 inw(dev->base_addr + FT1000_REG_MAG_DFSR); 1474 1448 } 1475 1449 i++; 1476 - // This should never happen unless the ASIC is broken. 1477 - // We must reset to recover. 1450 + /* 1451 + * This should never happen unless the ASIC is broken. 1452 + * We must reset to recover. 1453 + */ 1478 1454 if ((i > 2048) || (tempword == 0)) { 1479 1455 if (info->AsicID == ELECTRABUZZ_ID) { 1480 1456 info->DSP_TIME[0] = ··· 1510 1482 FT1000_MAG_DSP_TIMER3_INDX); 1511 1483 } 1512 1484 if (tempword == 0) { 1513 - // Let's check if ASIC reads are still ok by reading the Mask register 1514 - // which is never zero at this point of the code. 1485 + /* 1486 + * Let's check if ASIC reads are still ok by reading the Mask register 1487 + * which is never zero at this point of the code. 1488 + */ 1515 1489 tempword = 1516 1490 inw(dev->base_addr + 1517 1491 FT1000_REG_SUP_IMASK); 1518 1492 if (tempword == 0) { 1519 - // This indicates that we can not communicate with the ASIC 1493 + /* This indicates that we can not communicate with the ASIC */ 1520 1494 info->DrvErrNum = 1521 1495 FIFO_FLUSH_BADCNT; 1522 1496 } else { 1523 - // Let's assume that we really flush the FIFO 1497 + /* Let's assume that we really flush the FIFO */ 1524 1498 pcmcia->PktIntfErr++; 1525 1499 return; 1526 1500 } ··· 1536 1506 if (info->AsicID == ELECTRABUZZ_ID) { 1537 1507 i++; 1538 1508 DEBUG(0, "Flushing FIFO complete = %x\n", tempword); 1539 - // Flush last word in FIFO. 1509 + /* Flush last word in FIFO. */ 1540 1510 tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); 1541 - // Update FIFO counter for DSP 1511 + /* Update FIFO counter for DSP */ 1542 1512 i = i * 2; 1543 1513 DEBUG(0, "Flush Data byte count to dsp = %d\n", i); 1544 1514 info->fifo_cnt += i; ··· 1546 1516 info->fifo_cnt); 1547 1517 } else { 1548 1518 DEBUG(0, "Flushing FIFO complete = %x\n", tempword); 1549 - // Flush last word in FIFO 1519 + /* Flush last word in FIFO */ 1550 1520 templong = inl(dev->base_addr + FT1000_REG_MAG_DFR); 1551 1521 tempword = inw(dev->base_addr + FT1000_REG_SUP_STAT); 1552 1522 DEBUG(0, "FT1000_REG_SUP_STAT = 0x%x\n", tempword); ··· 1559 1529 } 1560 1530 } 1561 1531 1562 - //--------------------------------------------------------------------------- 1563 - // 1564 - // Function: ft1000_copy_up_pkt 1565 - // Description: This function will pull Flarion packets out of the Downlink 1566 - // FIFO and convert it to an ethernet packet. The ethernet packet will 1567 - // then be deliver to the TCP/IP stack. 1568 - // Input: 1569 - // dev - device structure 1570 - // Output: 1571 - // status - FAILURE 1572 - // SUCCESS 1573 - // 1574 - //--------------------------------------------------------------------------- 1532 + /*--------------------------------------------------------------------------- 1533 + 1534 + Function: ft1000_copy_up_pkt 1535 + Description: This function will pull Flarion packets out of the Downlink 1536 + FIFO and convert it to an ethernet packet. The ethernet packet will 1537 + then be deliver to the TCP/IP stack. 1538 + Input: 1539 + dev - device structure 1540 + Output: 1541 + status - FAILURE 1542 + SUCCESS 1543 + 1544 + -------------------------------------------------------------------------*/ 1575 1545 static int ft1000_copy_up_pkt(struct net_device *dev) 1576 1546 { 1577 1547 u16 tempword; ··· 1586 1556 u32 templong; 1587 1557 1588 1558 DEBUG(1, "ft1000_copy_up_pkt\n"); 1589 - // Read length 1559 + /* Read length */ 1590 1560 if (info->AsicID == ELECTRABUZZ_ID) { 1591 1561 tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); 1592 1562 len = tempword; ··· 1600 1570 if (len > ENET_MAX_SIZE) { 1601 1571 DEBUG(0, "size of ethernet packet invalid\n"); 1602 1572 if (info->AsicID == MAGNEMITE_ID) { 1603 - // Read High word to complete 32 bit access 1573 + /* Read High word to complete 32 bit access */ 1604 1574 tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH); 1605 1575 } 1606 1576 ft1000_flush_fifo(dev, DSP_PKTLEN_INFO); ··· 1612 1582 1613 1583 if (skb == NULL) { 1614 1584 DEBUG(0, "No Network buffers available\n"); 1615 - // Read High word to complete 32 bit access 1585 + /* Read High word to complete 32 bit access */ 1616 1586 if (info->AsicID == MAGNEMITE_ID) { 1617 1587 tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH); 1618 1588 } ··· 1622 1592 } 1623 1593 pbuffer = (u8 *) skb_put(skb, len + 12); 1624 1594 1625 - // Pseudo header 1595 + /* Pseudo header */ 1626 1596 if (info->AsicID == ELECTRABUZZ_ID) { 1627 1597 for (i = 1; i < 7; i++) { 1628 1598 tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); 1629 1599 chksum ^= tempword; 1630 1600 } 1631 - // read checksum value 1601 + /* read checksum value */ 1632 1602 tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); 1633 1603 } else { 1634 1604 tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH); ··· 1655 1625 DEBUG(1, "Pseudo = 0x%x\n", tempword); 1656 1626 chksum ^= tempword; 1657 1627 1658 - // read checksum value 1628 + /* read checksum value */ 1659 1629 tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH); 1660 1630 DEBUG(1, "Pseudo = 0x%x\n", tempword); 1661 1631 } ··· 1668 1638 kfree_skb(skb); 1669 1639 return FAILURE; 1670 1640 } 1671 - //subtract the number of bytes read already 1641 + /* subtract the number of bytes read already */ 1672 1642 ptemp = pbuffer; 1673 1643 1674 - // fake MAC address 1644 + /* fake MAC address */ 1675 1645 *pbuffer++ = dev->dev_addr[0]; 1676 1646 *pbuffer++ = dev->dev_addr[1]; 1677 1647 *pbuffer++ = dev->dev_addr[2]; ··· 1696 1666 } 1697 1667 } 1698 1668 1699 - // Need to read one more word if odd byte 1669 + /* Need to read one more word if odd byte */ 1700 1670 if (len & 0x0001) { 1701 1671 tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO); 1702 1672 *pbuffer++ = (u8) (tempword >> 8); ··· 1709 1679 *ptemplong++ = templong; 1710 1680 } 1711 1681 1712 - // Need to read one more word if odd align. 1682 + /* Need to read one more word if odd align. */ 1713 1683 if (len & 0x0003) { 1714 1684 templong = inl(dev->base_addr + FT1000_REG_MAG_DFR); 1715 1685 DEBUG(1, "Data = 0x%8x\n", templong); ··· 1729 1699 netif_rx(skb); 1730 1700 1731 1701 info->stats.rx_packets++; 1732 - // Add on 12 bytes for MAC address which was removed 1702 + /* Add on 12 bytes for MAC address which was removed */ 1733 1703 info->stats.rx_bytes += (len + 12); 1734 1704 1735 1705 if (info->AsicID == ELECTRABUZZ_ID) { 1736 - // track how many bytes have been read from FIFO - round up to 16 bit word 1706 + /* track how many bytes have been read from FIFO - round up to 16 bit word */ 1737 1707 tempword = len + 16; 1738 1708 if (tempword & 0x01) 1739 1709 tempword++; ··· 1745 1715 return SUCCESS; 1746 1716 } 1747 1717 1748 - //--------------------------------------------------------------------------- 1749 - // 1750 - // Function: ft1000_copy_down_pkt 1751 - // Description: This function will take an ethernet packet and convert it to 1752 - // a Flarion packet prior to sending it to the ASIC Downlink 1753 - // FIFO. 1754 - // Input: 1755 - // dev - device structure 1756 - // packet - address of ethernet packet 1757 - // len - length of IP packet 1758 - // Output: 1759 - // status - FAILURE 1760 - // SUCCESS 1761 - // 1762 - //--------------------------------------------------------------------------- 1718 + /*--------------------------------------------------------------------------- 1719 + 1720 + Function: ft1000_copy_down_pkt 1721 + Description: This function will take an ethernet packet and convert it to 1722 + a Flarion packet prior to sending it to the ASIC Downlink 1723 + FIFO. 1724 + Input: 1725 + dev - device structure 1726 + packet - address of ethernet packet 1727 + len - length of IP packet 1728 + Output: 1729 + status - FAILURE 1730 + SUCCESS 1731 + 1732 + -------------------------------------------------------------------------*/ 1763 1733 static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) 1764 1734 { 1765 1735 struct ft1000_info *info = netdev_priv(dev); ··· 1774 1744 1775 1745 DEBUG(1, "ft1000_hw: copy_down_pkt()\n"); 1776 1746 1777 - // Check if there is room on the FIFO 1747 + /* Check if there is room on the FIFO */ 1778 1748 if (len > ft1000_read_fifo_len(dev)) { 1779 1749 udelay(10); 1780 1750 if (len > ft1000_read_fifo_len(dev)) { ··· 1799 1769 return SUCCESS; 1800 1770 } 1801 1771 } 1802 - // Create pseudo header and send pseudo/ip to hardware 1772 + /* Create pseudo header and send pseudo/ip to hardware */ 1803 1773 if (info->AsicID == ELECTRABUZZ_ID) { 1804 1774 pseudo.blk.length = len; 1805 1775 } else { 1806 1776 pseudo.blk.length = ntohs(len); 1807 1777 } 1808 - pseudo.blk.source = DSPID; // Need to swap to get in correct order 1778 + pseudo.blk.source = DSPID; /* Need to swap to get in correct order */ 1809 1779 pseudo.blk.destination = HOSTID; 1810 - pseudo.blk.portdest = NETWORKID; // Need to swap to get in correct order 1780 + pseudo.blk.portdest = NETWORKID; /* Need to swap to get in correct order */ 1811 1781 pseudo.blk.portsrc = DSPAIRID; 1812 1782 pseudo.blk.sh_str_id = 0; 1813 1783 pseudo.blk.control = 0; ··· 1821 1791 pseudo.blk.checksum ^= pseudo.buff[i]; 1822 1792 } 1823 1793 1824 - // Production Mode 1794 + /* Production Mode */ 1825 1795 if (info->AsicID == ELECTRABUZZ_ID) { 1826 - // copy first word to UFIFO_BEG reg 1796 + /* copy first word to UFIFO_BEG reg */ 1827 1797 ft1000_write_reg(dev, FT1000_REG_UFIFO_BEG, pseudo.buff[0]); 1828 1798 DEBUG(1, "ft1000_hw:ft1000_copy_down_pkt:data 0 BEG = 0x%04x\n", 1829 1799 pseudo.buff[0]); 1830 1800 1831 - // copy subsequent words to UFIFO_MID reg 1801 + /* copy subsequent words to UFIFO_MID reg */ 1832 1802 ft1000_write_reg(dev, FT1000_REG_UFIFO_MID, pseudo.buff[1]); 1833 1803 DEBUG(1, "ft1000_hw:ft1000_copy_down_pkt:data 1 MID = 0x%04x\n", 1834 1804 pseudo.buff[1]); ··· 1851 1821 DEBUG(1, "ft1000_hw:ft1000_copy_down_pkt:data 7 MID = 0x%04x\n", 1852 1822 pseudo.buff[7]); 1853 1823 1854 - // Write PPP type + IP Packet into Downlink FIFO 1824 + /* Write PPP type + IP Packet into Downlink FIFO */ 1855 1825 for (i = 0; i < (len >> 1) - 1; i++) { 1856 1826 ft1000_write_reg(dev, FT1000_REG_UFIFO_MID, 1857 1827 htons(*packet)); ··· 1861 1831 packet++; 1862 1832 } 1863 1833 1864 - // Check for odd byte 1834 + /* Check for odd byte */ 1865 1835 if (len & 0x0001) { 1866 1836 ft1000_write_reg(dev, FT1000_REG_UFIFO_MID, 1867 1837 htons(*packet)); ··· 1900 1870 *(u32 *) & pseudo.buff[6]); 1901 1871 1902 1872 plong = (u32 *) packet; 1903 - // Write PPP type + IP Packet into Downlink FIFO 1873 + /* Write PPP type + IP Packet into Downlink FIFO */ 1904 1874 for (i = 0; i < (len >> 2); i++) { 1905 1875 outl(*plong++, dev->base_addr + FT1000_REG_MAG_UFDR); 1906 1876 } 1907 1877 1908 - // Check for odd alignment 1878 + /* Check for odd alignment */ 1909 1879 if (len & 0x0003) { 1910 1880 DEBUG(1, 1911 1881 "ft1000_hw:ft1000_copy_down_pkt:data = 0x%8x\n", ··· 1916 1886 } 1917 1887 1918 1888 info->stats.tx_packets++; 1919 - // Add 14 bytes for MAC address plus ethernet type 1889 + /* Add 14 bytes for MAC address plus ethernet type */ 1920 1890 info->stats.tx_bytes += (len + 14); 1921 1891 return SUCCESS; 1922 1892 } ··· 1961 1931 ft1000_disable_interrupts(dev); 1962 1932 ft1000_write_reg(dev, FT1000_REG_RESET, DSP_RESET_BIT); 1963 1933 1964 - //reset ASIC 1934 + /* reset ASIC */ 1965 1935 ft1000_reset_asic(dev); 1966 1936 } 1967 1937 return 0; ··· 2025 1995 2026 1996 ft1000_disable_interrupts(dev); 2027 1997 2028 - // Read interrupt type 1998 + /* Read interrupt type */ 2029 1999 inttype = ft1000_read_reg(dev, FT1000_REG_SUP_ISR); 2030 2000 2031 - // Make sure we process all interrupt before leaving the ISR due to the edge trigger interrupt type 2001 + /* Make sure we process all interrupt before leaving the ISR due to the edge trigger interrupt type */ 2032 2002 while (inttype) { 2033 2003 if (inttype & ISR_DOORBELL_PEND) 2034 2004 ft1000_parse_dpram_msg(dev); ··· 2038 2008 2039 2009 cnt = 0; 2040 2010 do { 2041 - // Check if we have packets in the Downlink FIFO 2011 + /* Check if we have packets in the Downlink FIFO */ 2042 2012 if (info->AsicID == ELECTRABUZZ_ID) { 2043 2013 tempword = 2044 2014 ft1000_read_reg(dev, ··· 2057 2027 } while (cnt < MAX_RCV_LOOP); 2058 2028 2059 2029 } 2060 - // clear interrupts 2030 + /* clear interrupts */ 2061 2031 tempword = ft1000_read_reg(dev, FT1000_REG_SUP_ISR); 2062 2032 DEBUG(1, "ft1000_hw: interrupt status register = 0x%x\n", tempword); 2063 2033 ft1000_write_reg(dev, FT1000_REG_SUP_ISR, tempword); 2064 2034 2065 - // Read interrupt type 2035 + /* Read interrupt type */ 2066 2036 inttype = ft1000_read_reg (dev, FT1000_REG_SUP_ISR); 2067 2037 DEBUG(1,"ft1000_hw: interrupt status register after clear = 0x%x\n",inttype); 2068 2038 } ··· 2074 2044 { 2075 2045 struct ft1000_info *info = netdev_priv(dev); 2076 2046 struct prov_record *ptr; 2077 - // int cnt; 2047 + /* int cnt; */ 2078 2048 2079 2049 DEBUG(0, "ft1000_hw: stop_ft1000_card()\n"); 2080 2050 ··· 2083 2053 netif_stop_queue(dev); 2084 2054 ft1000_disable_interrupts(dev); 2085 2055 2086 - // Make sure we free any memory reserve for provisioning 2056 + /* Make sure we free any memory reserve for provisioning */ 2087 2057 while (list_empty(&info->prov_list) == 0) { 2088 2058 ptr = list_entry(info->prov_list.next, struct prov_record, list); 2089 2059 list_del(&ptr->list); ··· 2139 2109 struct ft1000_pcmcia *pcmcia; 2140 2110 struct net_device *dev; 2141 2111 2142 - static const struct net_device_ops ft1000ops = // Slavius 21.10.2009 due to kernel changes 2112 + static const struct net_device_ops ft1000ops = /* Slavius 21.10.2009 due to kernel changes */ 2143 2113 { 2144 2114 .ndo_open = &ft1000_open, 2145 2115 .ndo_stop = &ft1000_close, ··· 2199 2169 2200 2170 info->squeseqnum = 0; 2201 2171 2202 - // dev->hard_start_xmit = &ft1000_start_xmit; 2203 - // dev->get_stats = &ft1000_stats; 2204 - // dev->open = &ft1000_open; 2205 - // dev->stop = &ft1000_close; 2172 + /* dev->hard_start_xmit = &ft1000_start_xmit; */ 2173 + /* dev->get_stats = &ft1000_stats; */ 2174 + /* dev->open = &ft1000_open; */ 2175 + /* dev->stop = &ft1000_close; */ 2206 2176 2207 - dev->netdev_ops = &ft1000ops; // Slavius 21.10.2009 due to kernel changes 2177 + dev->netdev_ops = &ft1000ops; /* Slavius 21.10.2009 due to kernel changes */ 2208 2178 2209 2179 DEBUG(0, "device name = %s\n", dev->name); 2210 2180
+31 -31
drivers/staging/ft1000/ft1000-usb/ft1000_download.c
··· 55 55 56 56 #define MAX_LENGTH 0x7f0 57 57 58 - // Temporary download mechanism for Magnemite 58 + /* Temporary download mechanism for Magnemite */ 59 59 #define DWNLD_MAG_TYPE_LOC 0x00 60 60 #define DWNLD_MAG_LEN_LOC 0x01 61 61 #define DWNLD_MAG_ADDR_LOC 0x02 ··· 74 74 #define HANDSHAKE_MAG_TIMEOUT_VALUE 0xF1F1 75 75 76 76 77 - // New Magnemite downloader 77 + /* New Magnemite downloader */ 78 78 #define DWNLD_MAG1_HANDSHAKE_LOC 0x00 79 79 #define DWNLD_MAG1_TYPE_LOC 0x01 80 80 #define DWNLD_MAG1_SIZE_LOC 0x02 81 81 #define DWNLD_MAG1_PS_HDR_LOC 0x03 82 82 83 83 struct dsp_file_hdr { 84 - long version_id; // Version ID of this image format. 85 - long package_id; // Package ID of code release. 86 - long build_date; // Date/time stamp when file was built. 87 - long commands_offset; // Offset to attached commands in Pseudo Hdr format. 88 - long loader_offset; // Offset to bootloader code. 89 - long loader_code_address; // Start address of bootloader. 90 - long loader_code_end; // Where bootloader code ends. 84 + long version_id; /* Version ID of this image format. */ 85 + long package_id; /* Package ID of code release. */ 86 + long build_date; /* Date/time stamp when file was built. */ 87 + long commands_offset; /* Offset to attached commands in Pseudo Hdr format. */ 88 + long loader_offset; /* Offset to bootloader code. */ 89 + long loader_code_address; /* Start address of bootloader. */ 90 + long loader_code_end; /* Where bootloader code ends. */ 91 91 long loader_code_size; 92 - long version_data_offset; // Offset were scrambled version data begins. 93 - long version_data_size; // Size, in words, of scrambled version data. 94 - long nDspImages; // Number of DSP images in file. 92 + long version_data_offset; /* Offset were scrambled version data begins. */ 93 + long version_data_size; /* Size, in words, of scrambled version data. */ 94 + long nDspImages; /* Number of DSP images in file. */ 95 95 }; 96 96 97 97 #pragma pack(1) 98 98 struct dsp_image_info { 99 - long coff_date; // Date/time when DSP Coff image was built. 100 - long begin_offset; // Offset in file where image begins. 101 - long end_offset; // Offset in file where image begins. 102 - long run_address; // On chip Start address of DSP code. 103 - long image_size; // Size of image. 104 - long version; // Embedded version # of DSP code. 105 - unsigned short checksum; // DSP File checksum 99 + long coff_date; /* Date/time when DSP Coff image was built. */ 100 + long begin_offset; /* Offset in file where image begins. */ 101 + long end_offset; /* Offset in file where image begins. */ 102 + long run_address; /* On chip Start address of DSP code. */ 103 + long image_size; /* Size of image. */ 104 + long version; /* Embedded version # of DSP code. */ 105 + unsigned short checksum; /* DSP File checksum */ 106 106 unsigned short pad1; 107 107 }; 108 108 ··· 511 511 512 512 static void usb_dnld_complete(struct urb *urb) 513 513 { 514 - //DEBUG("****** usb_dnld_complete\n"); 514 + /* DEBUG("****** usb_dnld_complete\n"); */ 515 515 } 516 516 517 517 /* writes a block of DSP image to DPRAM ··· 651 651 ft1000dev->usbboot = 0; 652 652 ft1000dev->dspalive = 0xffff; 653 653 654 - // 655 - // Get version id of file, at first 4 bytes of file, for newer files. 656 - // 654 + /* 655 + * Get version id of file, at first 4 bytes of file, for newer files. 656 + */ 657 657 658 658 state = STATE_START_DWNLD; 659 659 ··· 702 702 /* Reposition ptrs to beginning of code section */ 703 703 s_file = (u16 *) (boot_end); 704 704 c_file = (u8 *) (boot_end); 705 - //DEBUG("FT1000:download:s_file = 0x%8x\n", (int)s_file); 706 - //DEBUG("FT1000:download:c_file = 0x%8x\n", (int)c_file); 705 + /* DEBUG("FT1000:download:s_file = 0x%8x\n", (int)s_file); */ 706 + /* DEBUG("FT1000:download:c_file = 0x%8x\n", (int)c_file); */ 707 707 state = STATE_CODE_DWNLD; 708 708 ft1000dev->fcodeldr = 1; 709 709 break; ··· 735 735 break; 736 736 737 737 case STATE_CODE_DWNLD: 738 - //DEBUG("FT1000:STATE_CODE_DWNLD\n"); 738 + /* DEBUG("FT1000:STATE_CODE_DWNLD\n"); */ 739 739 ft1000dev->bootmode = 0; 740 740 if (ft1000dev->usbboot) 741 741 handshake = ··· 805 805 state = STATE_DONE_DWNLD; 806 806 break; 807 807 case REQUEST_CODE_SEGMENT: 808 - //DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); 808 + /* DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); */ 809 809 if (!correct_version) { 810 810 DEBUG 811 811 ("FT1000:download:Download error: Got Code Segment request before image offset request.\n"); ··· 823 823 case REQUEST_MAILBOX_DATA: 824 824 DEBUG 825 825 ("FT1000:download: REQUEST_MAILBOX_DATA\n"); 826 - // Convert length from byte count to word count. Make sure we round up. 826 + /* Convert length from byte count to word count. Make sure we round up. */ 827 827 word_length = 828 828 (long)(pft1000info->DSPInfoBlklen + 829 829 1) / 2; ··· 939 939 } 940 940 dsp_img_info++; 941 941 942 - } //end of for 942 + } /* end of for */ 943 943 944 944 if (!correct_version) { 945 945 /* ··· 1002 1002 (u32) (pseudo_header_len + 1003 1003 sizeof(struct 1004 1004 pseudo_hdr))); 1005 - // link provisioning data 1005 + /* link provisioning data */ 1006 1006 pprov_record = 1007 1007 kmalloc(sizeof(struct prov_record), 1008 1008 GFP_ATOMIC); ··· 1013 1013 list, 1014 1014 &pft1000info-> 1015 1015 prov_list); 1016 - // Move to next entry if available 1016 + /* Move to next entry if available */ 1017 1017 c_file = 1018 1018 (u8 *) ((unsigned long) 1019 1019 c_file +