-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runner #14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add lock to gaurd hw access during tx transactions. Add check for atleast one credit before queuing tx transaction. If a credit isn't immediately available, we'll poll for an rx transaction to get a credit to continue the tx transaction. Adds two new functions: waitForCredit() and f2PacketAvail(). We'll re-use both when the doIoctlSet|Get get re-worked in next commits.
Protect hw access by holding lock. Check for a credit before send_ioctl. If not credits available, poll waiting for a credit so we can continue with send_ioctl.
Use cached status from previous cmd_read|cmd_write in check_status, rather than reading status reg.
…events (yet) offset/plen can be added later when needed for events with payload (scan?)
scottfeldman
commented
Sep 12, 2023
fix data race and add netlink iface
Merged! Thanks Scott! |
soypat
added a commit
that referenced
this pull request
Sep 13, 2023
* begin adding rewrite based on new ref * bus init finished * firmware download complete, core disable failing * rework cywanalyze * firmware flash success * most of transactions match, still failing * init near identical to ref and working * add ioctl.go * blinky works * add better async events * small fix * forgot to run stringer * hard fault @ fmt.Printf(cdc_struct=%+vn, d.auxCDCHeader) * checkpoint WIP on d.rx() * keep working on clm load * clean up a few things * flesh out rxControl * flesh out rxData * tiden up compile errors * continue work; correct CDCHeader endianness bug * fix bug in bp_read; add Wifi * better EventHeader type unmarshal; create debug.go * fix OOB bug in log * tidy up logging and some parts of code * add way to print out low level gSPI transactions * refactor whd; remove IoctlHeader (same as CDC) * add comments * Runner (#14) * fix logic to match ref * embed sync.Mutex directly in Device struct * add polling go func to async service F2 pkts * tx: add check for credit and protect with lock Add lock to gaurd hw access during tx transactions. Add check for atleast one credit before queuing tx transaction. If a credit isn't immediately available, we'll poll for an rx transaction to get a credit to continue the tx transaction. Adds two new functions: waitForCredit() and f2PacketAvail(). We'll re-use both when the doIoctlSet|Get get re-worked in next commits. * rework doIoctlSet|Get Protect hw access by holding lock. Check for a credit before send_ioctl. If not credits available, poll waiting for a credit so we can continue with send_ioctl. * use cached status in check_status Use cached status from previous cmd_read|cmd_write in check_status, rather than reading status reg. * BUG FIX: return correct payload from SDPCM packet * BUG FIX: calculate correct offset/plen for IOCTL completion * s/IOCTL_HEADER_LEN/CDC_HEADER_LEN/ to align with CDC header usage * flesh out more of rxData * rxEvent: process BDC hdr like ref; don't try to calc offset/plen for events (yet) offset/plen can be added later when needed for events with payload (scan?) * fix country info to include full 12 bytes * BUG FIX: s/GET/SET on setting antenna * BUG FIX: stepping on iface in events * BUG FIX: type on set_power_management * move set_power_management call to end of control init * add secrets.go for Wifi SSID/Passphrase * git ignore secrets.go * use secrets.go.template so secrets.go doesn't get checked back in * fix secrets.go usage...oops * get Wifi login working for wpa2 * fix data race in Device buffers by keeping locks around exported and async routines * use pollForIoctl in waitForCredit * replace other uses of d.spi.Status with s.status calls * add netlinker interface and LED activity indicator to cmd/cyrw * apply scott suggestions; apply a 'fix' to ethertype panic, seems to happen regularly --------- Co-authored-by: soypat <graded.sp@gmail.com> --------- Co-authored-by: Scott Feldman <sfeldma@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening a PR to make review easier. Based on goembassy branch.
Lots of stuff in here, but end result is we have LINK and Rx pkts!
The traces from Saleae for both ref and cyrw drivers shows exact[1] transactions up to and including wifi join.
[1] there are some transaction size diffs due to cyrw dealing in uint32s, so sizes are always multiples of 4 for cyrw.