Commit graph

10340 commits

Author SHA1 Message Date
Gianguido Sorà
65b02632c2
Merge pull request #3 from bunnie/feat/usb-mass-storage
Feat/usb mass storage
2023-01-12 19:11:45 +01:00
Patryk Laurent
fb5811ddc8 use MAIN_SEPARATOR instead of hardcoded ':' 2023-01-12 07:20:43 -08:00
bunnie
55b1addf59 add vendoring notice and original copyright to all files vendored in. 2023-01-12 02:10:41 +08:00
bunnie
1a00e3cc2f fix whitespace 2023-01-12 02:06:27 +08:00
bunnie
8aa1301d68 more cleanup 2023-01-12 01:51:50 +08:00
bunnie
bebf323798 some touch-up/cleanup; add a timeout on a blocking read 2023-01-12 01:45:51 +08:00
bunnie
1ec6bd7df4 remove some test files that aren't relevant to our build 2023-01-12 01:17:04 +08:00
bunnie
cd62caadcd fix paths and README 2023-01-12 01:13:21 +08:00
bunnie
ed23cdcc17 move crates to the libs/mass-storage directory 2023-01-12 01:12:56 +08:00
bunnie
88cdde4b9a remove unused files 2023-01-12 01:04:12 +08:00
bunnie
54467a75fc gate mass-storage behind a feature that is currently default off 2023-01-12 00:58:48 +08:00
bunnie
55b940fe74 tiny bit of cleanup & docs 2023-01-11 04:09:13 +08:00
bunnie
1f3c16aea8 add ReadFormatCapacities
this is required by Windows for the driver to work.
2023-01-11 03:55:04 +08:00
bunnie
93e3bc29b3 usb disk now working well without debugging messages 2023-01-11 02:00:32 +08:00
bunnie
d592bab121 head pointer offset is the most reliable way to determine transaction in progress
before we were looking at the amount of data transferred and
seeing if it matches the expected amount

I just realized that we can just look at the descriptor pointer in
the status region; if it is non-zero, then the descriptor set
is "live" and needs to be filled.

if it's zero, then a packet came in.

use this to fix the wait conditions for accepting new commands.
2023-01-11 01:59:13 +08:00
bunnie
f0d1c65c2a repair the minimal config for faster USB debugging 2023-01-11 01:58:15 +08:00
bunnie
921199b429 a cleaner version that works 2023-01-10 14:44:52 +08:00
bunnie
3355f3b5f4 writes now working, barely. 2023-01-10 05:21:11 +08:00
bunnie
5c1518cee6 block reads work. 2023-01-09 19:04:47 +08:00
bunnie
3d826ffbbe add bulk response chaining
IN descriptors now chain up to 512 bytes long

OUT descriptors still need to be worked up

However, there is an issue where the system is injecting the
ZLP/CSW immediately after the bulk response is queued up, and this
is getting sent before the bulk data is issued. Need to figure out
this race condition.
2023-01-09 04:14:59 +08:00
bunnie
10e605569f reduce InquiryResponse record 2023-01-07 00:22:26 +08:00
bunnie
d0afd80647 bump lockfile 2023-01-06 18:05:49 +08:00
bunnie
ce9accbfb8 revert accidental commit 2023-01-06 18:05:40 +08:00
bunnie
41d4837551 bump versions to absorb WDT change 2023-01-06 17:48:12 +08:00
bunnie
0f0b51c779 bump watchdog timer to a longer interval 2023-01-06 17:46:18 +08:00
bunnie
cf5b181b03 convert extra EP to interrupt 2023-01-06 17:44:04 +08:00
bunnie
5c5bed2722 working past scsi inquiry response issue 2023-01-06 03:54:02 +08:00
bunnie
02ffa530f6 remove unused test routine 2023-01-06 00:45:20 +08:00
bunnie
df9d7b4eb0 try once again to lean up the dependency tree for usb_update.py 2023-01-06 00:45:05 +08:00
bunnie
8ff492914b remove bip_utils dependency from usb_update.py 2023-01-05 23:47:53 +08:00
Gianguido Sorà
17831fe82b
add foo endpoint to make enumeration work 2023-01-05 15:58:52 +01:00
bunnie
de231cae54 explain to users that they will need to create a PIN code for logins
Users are confused when they are prompted to enter a PIN code for
the first time with no preparation. Update the format request message
to prime users for the task.
2023-01-05 16:42:12 +08:00
bunnie
4ec16dfbb1 bump lockfile from version push 2023-01-05 14:27:19 +08:00
bunnie
7b2bfcb247 fix #291: give backups a default name that includes a timestamp
this prevents backups from being overwritten by accident.
2023-01-05 14:26:43 +08:00
bunnie
bb5d7b3adf bump versions to absorb hosted mode fix 2023-01-05 14:07:24 +08:00
bunnie
64fa83cec4
Merge pull request #290 from betrusted-io/reply-and-receive-next-syscall
Fix ReplyAndReceiveNext for hosted mode
2023-01-05 13:56:24 +08:00
Sean Cross
3593d715c1 kernel: fix memorymessages with ReplyAndReceiveNext
Fix a segfault that occurred when using ReplyAndReceiveNext on hosted
mode. This now properly passes memory messages back to the client.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-05 11:56:15 +08:00
Sean Cross
81351bed32 xous: syscall: support call.memory() for ReplyAndReceiveNext
Much of the hosted machinery requires the ability to access memory on
syscalls. This feature was overlooked in the previous implementation of
ReplyAndReceiveNext, which caused it to not properly return memory.

Implement the ability to call `.memory()` on ReplyAndReceiveNext
messages.

Note that this requires the use of a sentinal value in the
previously-unused `valid` field.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-05 11:53:59 +08:00
Gianguido Sorà
b800fbdbd5
cargo toml updates 2023-01-04 17:22:50 +01:00
Gianguido Sorà
637a3d1371
usb-device-xous: basic mass storage implementation
needs to be cleaned up before merging upstream
2023-01-04 17:22:41 +01:00
Gianguido Sorà
3300a1b87d
block_device: added empty implementation, will be needed once we figure out mass storage 2023-01-04 17:22:13 +01:00
Gianguido Sorà
110641ff76
shellchat: add ms verb to usb
Used to switch core to mass-storage mode
2023-01-04 17:21:45 +01:00
Gianguido Sorà
24d7cb5fcb
dump of stm32-usb.rs repo, used for local dev, will properly fork if needed 2023-01-04 17:21:19 +01:00
bunnie
ec5435bd58 add basis cache clear on basis change callback as well 2023-01-04 04:15:44 +08:00
bunnie
57254ce47c clear local caches when basis state changes 2023-01-04 04:13:14 +08:00
bunnie
b02ab8a4cd bump release notes 2023-01-04 04:13:07 +08:00
bunnie
c3ecaa00eb refactor: remove allocs from vault inner loop
`vault` is changed so that instead of clearing the list of
data each time the screen is updated, it tries to compare it
against the existing data and modifies the record if it needs to,
or leaves it untouched.

Furthermore, at least in the password path, temporary strings
are pre-allocated and re-used, instead of freed and re-allocated
every time through the main loop.

The combination of these optimzations reduces the time to re-parse
a couple hundred records from about 1000ms to 200ms, reducing the
overall time to retrieve the database from 1.8s to 1.0s. It also
makes the loop much more stable over time; previously, as the heap
fragmented, performance would slowly degrade. Now that most
records are static and re-used, the performance seems to stay
constant.

The framwork is also put in place to re-use TOTP/U2F records,
but the code still uses the legacy method of clearing the
entire stored list and rebuilding it. However, it wasn't deemed
a priority to fix this because generally I haven't seen use cases
where users have hundreds of tokens or TOTP's; so long as the
number is about 20 or so, the performance difference should
be imperceptible with or without optimization.
2023-01-04 03:03:19 +08:00
bunnie
10b921e4e8 cleanup another format, add some more analytics 2023-01-03 23:36:46 +08:00
bunnie
454f41c3b2 update perf image soc to latest rev 2023-01-03 23:25:58 +08:00
bunnie
399a83b52e note the removal of bip-utils 2023-01-03 03:49:45 +08:00