aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/csr1212.c
Commit message (Collapse)AuthorAgeFilesLines
* ieee1394/csr1212: fix false positive kmemcheck reportVegard Nossum2009-06-151-0/+2
| | | | | | | | | | kmemcheck reports a use of uninitialized memory here, but it's not a real error. The structure in question has just been allocated, and the whole field is initialized, but it happens in two steps. We fix the false positive by inserting a kmemcheck annotation. Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
* ieee1394: ignore nonzero Bus_Info_Block.max_rom, fetch config ROM in quadletsStefan Richter2009-01-041-31/+14
| | | | | | | | | | | | | | | | | | It is already known that buggy firmwares exist which report a bogus link_spd in their config ROM bus info block. We now got the first report of a bogus max_rom too (Freecom FireWire Hard Drive 1TB, http://bugzilla.kernel.org/show_bug.cgi?id=12206). I suspect other OSs only use quadlet reads to fetch the config ROM, otherwise the firmware authors would have noticed their mistake. Hence limit ieee1394's config ROM fetching routine to quadlets as the safe minimum regardless of what the bus info block says. This will potentially slow the bus reset handling by nodemgr somewhat down. But most existing devices support only quadlet reads anyway, hence there will often be no actual difference to before this change. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: Use DIV_ROUND_UPJulia Lawall2008-10-151-1/+1
| | | | | Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: reduce log noise about config ROM CRC errorsStefan Richter2008-07-141-10/+22
| | | | | | | This avoids redundant messages about a special and usually harmless firmware flaw. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: proper refcountingStefan Richter2007-10-161-27/+30
| | | | | | | | | | | | At least since nodemgr got rid of coarse global locking, accesses to struct csr1212_keyval's reference counter should be atomic and coupled with proper barriers. Also, calls to csr1212_keep_keyval(kv) should occur before kv is being used. (We probably should convert refcnt to struct kref, but how to keep csr1212_destroy_keyval's implementation non-recursively then?) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: log if devices have CRC errors in their ROMStefan Richter2007-04-301-18/+9
| | | | | | | | | This will point out firmware bugs. I tested with 11 SBP-2 devices and one OS X PC and got these errors from two old CD-RWs only. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: more sensible names for jump targetsStefan Richter2007-04-301-10/+8
| | | | | | | Code beneath two labels called "fail" is actually also reached in case of success. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: warn on unreachable codeStefan Richter2007-04-301-2/+5
| | | | | | We want bugs to show themselves. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: shrink csr1212_new_string_descriptor_leafStefan Richter2007-04-301-77/+46
| | | | | | | Make unnecessarily generic code specific and thus simpler. Shrink a lookup table from 128 to 16 bytes. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: coding styleStefan Richter2007-04-301-97/+118
| | | | | | Whitespace, line breaks, braces... Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: replace vmalloc by kmalloc in csr1212Stefan Richter2007-04-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The biggest chunk ever allocated by CSR1212_MALLOC is 1024 Bytes + sizeof(struct csr1212_csr_rom_cache) big. Most of the time much smaller data structures are allocated. Therefore vmalloc is a waste. The one exception is csr1212_append_new_cache() which is called to append a chunk of CSR1212_EXTENDED_ROM_SIZE + sizeof(struct csr1212_csr_rom_cache) if the currently allocated ROM cache is too small. CSR1212_EXTENDED_ROM_SIZE is generously defined as 256 kBytes. In SVN commit 1220, Steve Kinneberg lowered this to 2 kBytes in the config_rom_2.4 branch. This same commit also switched CSR1212_MALLOC from kmalloc to vmalloc in the SVN trunk branch: > r1220 | kberg | 2004-05-31 01:51:44 +0200 (Mon, 31 May 2004) | 13 lines > > CSR1212 Extended ROM bug fixes: > trunk line changes: > - Use vmalloc instead of kmalloc > - Change delayed_reset_bus() to operate in a work_queue instead of a > timer interrupt. > - Fix hpsb_allocate_and_register_addrspace() to not allocate space > on top of already allocated space. > - Fix problems in csr1212.c filling ConfigROM images when extend > ROMs are present. > config-rom-2.4 changes: > - Changed extended rom allocation from 256K to 8K. (It was actually 2 kB, not 8 kB.) > - Fix hpsb_allocate_and_register_addrspace() to not allocate space > on top of already allocated space. > - Fix problems in csr1212.c filling ConfigROM images when extend > ROMs are present. I am now setting CSR1212_EXTENDED_ROM_SIZE to 2 kB minus the overhead of struct csr1212_csr_rom_cache. Note, this code path is not used by the in-kernel drivers though. raw1394 could trigger it, but the respective libraw1394 functions don't exist yet. Furthermore, userspace programs can replace the entire local ROM via raw1394. If kmalloc does not fulfill their needs --- well, tough luck. I decree that nobody needs such huge extended ROMs. (Extended ROMs are defined by IEEE 1212 clause 7.7.18. The spec does not impose practically relevant restrictions on the size of extended ROM chunks.) Another potentially demanding use of CSR1212_MALLOC is if external FireWire devices come with Extended ROM entries. If they are too big for kmalloc (or have been too big for vmalloc) we just fail to read their ROM. This is quite unlikely though, to my knowledge. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: de-inline some functionsStefan Richter2007-04-301-4/+24
| | | | | | | This small reorganization of public csr1212 functions saves one exported symbol and a few bytes in the driver modules. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: stricter error checks in csr1212Stefan Richter2007-04-301-43/+24
| | | | | | return -EINVAL becomes BUG_ON in checks of function call parameters. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: csr1212: rename some typesStefan Richter2007-04-301-48/+45
| | | | | | Use u8, u32 etc. instead of u_int8_t, csr1212_quad_t etc. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: drop csr1212's support for external compilationStefan Richter2007-04-301-85/+74
| | | | | | | | | | | csr1212 was written to be compiled either as part of the ieee1394 kernel driver or of an anticipated IEEE 1212 userspace library. We now drop support for the latter. The costs in terms of code footprint and depth of abstraction are not countered by any actual benefit. Also remove some obsolete #includes. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: remove unused csr1212 codeStefan Richter2007-04-301-224/+87
| | | | | | | | | Delete unused code. Make some extern functions static. Remove superfluous inline keywords. Move private definitions from csr1212.h to csr1212.c. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: nodemgr: check info_length in ROM header earlierStefan Richter2007-02-081-3/+6
| | | | | | | | | | | The whole ROM area which is covered by the crc_length field of the ROM header was fetched before the info_length field was checked for correct general ROM format. This might be wasteful or even dangerous with nodes with minimal ROM, nonstandard ROM, or corrupt ROM. Perform this check at the earliest opportunity. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: modified csr1212_key_id_type_map to support lisightAndrea Guzzo2007-02-081-3/+3
| | | | | | | | | | | | | | This patch applies a little change in csr1212.c to fix iSight (firewire digital camera) related issues (but maybe other firewire devices could also need such modification) The actual implementation of the "csr1212_key_id_type_map" table doesn't support some node types used by the iSight for the audio unit. This limit makes the csr scanning routine to never see the audio unit node , and consequently the iSight driver probe() routine to be never called and there is no way to hook an isight device when it is inserted. Signed-off-by: Andrea Guzzo <xant@xant.net> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: add preprocessor constant for invalid csr addressBen Collins2006-06-121-1/+1
| | | | | | | | Replace occurrences of the magic value ~(u64)0 for invalid CSR address spaces by a named constant for better readability. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
* csr1212: add check for !validJody McIntyre2005-11-221-1/+2
| | | | | | | Don't read the keyval if there's already a valid one in place. May not be necessary but shouldn't hurt. Signed-off-by: Jody McIntyre <scjdy@steamballoon.com>
* csr1212: check results of keyval readsJody McIntyre2005-11-221-3/+4
| | | | | | | | csr1212_parse_csr() did not properly check return values when reading keyvals. Fix this by using _csr1212_read_keyval() instead of csr1212_get_keyval() and checking the return code. Signed-off-by: Jody McIntyre <scjody@steamballoon.com>
* kmalloc/kzalloc changes:Stefan Richter2005-11-071-6/+5
| | | | | | | | | | dv1394, eth1394, ieee1394, ohci1394, pcilynx, raw1394, sbp2c, video1394: - use kzalloc - provide safer size arguments to kmalloc and kzalloc - omit some casts Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
* [PATCH] Sync up ieee-1394Ben Collins2005-07-101-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | Lots of this patch is trivial code cleanups (static vars were being intialized to 0, etc). There's also some fixes for ISO transmits (max buffer handling). Aswell, we have a few fixes to disable IRM capabilites correctly. We've also disabled, by default some generally unused EXPORT symbols for the sake of cleanliness in the kernel. However, instead of removing them completely, we felt it necessary to have a config option that allowed them to be enabled for the many projects outside of the main kernel tree that use our API for driver development. The primary reason for this patch is to revert a MODE6->MODE10 RBC conversion patch from the SCSI maintainers. The new conversions handled directly in the scsi layer do not seem to work for SBP2. This patch reverts to our old working code so that users can enjoy using Firewire disks and dvd drives again. We are working with the SCSI maintainers to resolve this issue outside of the main kernel tree. We'll merge the patch once the SCSI layer's handling of the MODE10 conversion is working for us. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Linux-2.6.12-rc2Linus Torvalds2005-04-161-0/+1612
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!