RFID: confirm the S10401 facility-code width and the Casi-Rusco offset pivot with card data
Two details of the formats added in #1149 (merged as 9effa4b44) rest on inference rather than on card data. Both are narrow, both are a one-line change if they turn out wrong, and @matthewb-worthe has ordered cards to settle each. Filing so they are not lost now that the PR is closed.
1. S10401 facility code: 6 bits at position 1, or Proxmark3's 4 bits at position 3?
applications/main/lfrfid/lfrfid_hid_format.c declares fc_position = 1, fc_size = 6. Proxmark3's MDI37 in client/src/wiegand_formats.c uses set_linear_field(packed, card->FacilityCode, 3, 4).
The parity half of this question is settled: 42 badges exported from a live access system all pass the 17-bit even parity the PR uses, and only the 13 with frame bit 18 clear pass Proxmark3's 18-bit span. The facility-code width is not, because every badge tested has facility code 9, so frame bits 1 and 2 have never been seen set and the two layouts return the same value.
The case for 6 bits is that vendor order forms offer facility code 0-63 and a 29-bit number range, which needs 6 bits; Proxmark3's 4-bit field would silently truncate any facility code of 16 or more.
Settles it: a badge with facility code >= 16. Cards with facility code 42 (101010, so bit order shows as well as width) are on order.
If wrong: badges with facility code >= 16 report the wrong facility code. Nothing else is affected.
2. Casi-Rusco: where does the 66606 offset begin?
applications/main/lfrfid/lfrfid_casi_format.c treats the card field as the printed number while its top bit is clear, and as the field less 66606 once set, which puts the split at card 195538 and makes the card numbers continuous. The plain alternative is a top-bit flag at field 262144, with no gap.
The two rules differ only for cards 195538-262143. No sample distinguishes them: the known low-branch cards stop at 173xxx and the offset-branch ones start at 286xxx. The offset itself is well supported - eleven badges across two sites, three of them public (reddit thread, reachable through the Wayback Machine), plus the Proxmark3 lf_Casi-12ed825c29.pm3 trace, which decodes to credential 155056 / card 154665 on the low branch.
Worth recording: that trace also settles that these badges are EM4100 at RF/32, not RF/64. Decoding it at RF/32 yields 12ED825C29 six times with valid row parity, column parity, stop bit and header; at RF/64 it yields no valid frame.
Settles it: ten sequential cards 195534-195543, straddling the inferred pivot. Under the current rule the raw field jumps from 195537 to 262144 between the fourth and fifth card; under the alternative it does not. On order.
If wrong: cards numbered 195538-262143 decode and encode with the wrong number. Other ranges are unaffected.
Also open
The round-3 follow-ups (9effa4b44 includes them) were not tested on hardware. The NumberInput change touches every number input in the firmware - a field whose range excludes 0, such as the Casi credential, should now open showing its minimum rather than blank.
Source: DarkFlippers/unleashed-firmware