Commit Graph
1852 Commits
Author SHA1 Message Date
Andre Brait 98763e3bff startup: clear MAP_FLASH_PAGE_TO_XDATA before the C runtime initialises xdata
Hardware reset starts the firmware with SFR 0x97 = 1, which maps xdata
0x4000-0xbfff to the flash image: reads return flash bytes, writes are
lost. main() cleared it only after __mcs51_genXINIT and the XSEG clear
had run, so XISEG (initialised globals) and the part of XSEG above
0x4000 kept stale RAM contents, e.g. session_timeout = 4484 and LLDP
blocked on logical ports 0, 3 and 5. Clear it in
__sdcc_external_startup(), which SDCC calls before both.

Rename SFR_97 to MAP_FLASH_PAGE_TO_XDATA.
2026-10-26 17:08:27 +01:00
logicog 80a30b705e Merge pull request #706 from DrDoof/feat/banner-compiler
build: show the compiler and the toolchain in the version banner
2026-10-26 14:41:50 +01:00
feelfree69 4c3e1fde81 Merge pull request #609 from mintsoft/vlan-manager-fixes
VLAN manager UI/fixes
2026-10-26 13:59:39 +01:00
feelfree69 5cd14e6227 Merge pull request #714 from rwalli/doc-hc-swtg124as-19650
doc: add HC-SWTG124AS on PCB-SWTG024AS-A-V2.0.1_19650 with SW1 reset …
2026-10-26 12:34:47 +01:00
rwalli@gmx.at 5105018d90 machine: reset button on GPIO48 for HC-SWTG124AS, drop braces around _19650
SW1 on PCB-SWTG024AS-A-V2.0.1_19650 is wired to GPIO48. Measured on
HC-SWTG124AS: GPIO48 reads 1 idle and 0 while the button is held.
HC_SWTG124AS.c is a symlink to PCB_SWTG024AS_A_2_0_1.c.
2026-10-26 12:23:28 +01:00
rwalli@gmx.at 5bc7cf43db doc: merge duplicate HC-SWTG124AS rows, note _19650 variant in existing entry 2026-10-26 12:00:38 +01:00
rwalli@gmx.at c776d10129 doc: add HC-SWTG124AS on PCB-SWTG024AS-A-V2.0.1_19650 with SW1 reset note 2026-10-26 11:30:31 +01:00
feelfree69 7b4d0d55d2 Merge pull request #713 from dobodu/main
Fix double sy_sysport_err and add new translations
2026-10-26 08:45:15 +01:00
dobodu fe1d4119d0 Fix double sy_sysport_err and add new translations
Removes
double entries for sy_sysport_err corrected
Add
sy_dns1, sy_dns2, sy_dns_err & sy_dns_dhcp translations
2026-10-26 00:13:49 +01:00
d00f c5f62bff95 build: name the sdcc/ revision in the toolchain line
A commit hash can be looked up directly, a checksum cannot. Print the last commit that touched sdcc/, with -dirty for local changes, and fall back to the checksum when git is not available. The toolchain directory keeps the checksum.
2026-10-25 22:49:37 +01:00
d00f 1b29fb687f build: count the sdcc patches in the toolchain line
The checksum changes with every patch but does not say how many there are. Print the number of patches in sdcc/ next to it.
2026-10-25 21:23:32 +01:00
Rob Emery 2e62f9eea7 Adding the name of the port to the UI so it's easier to see what
you are changing
2026-10-25 16:33:54 +00:00
feelfree69 5c6a82d50f Merge pull request #568 from DrDoof/fix/upload-boundary-cr
httpd: re-check the byte that breaks a partial boundary match
2026-10-25 16:52:47 +01:00
d00f 1d158d21d1 build: show the compiler and the toolchain in the version banner
The boot banner and the version command print the SDCC release and
revision from the compiler's own macros, and the name of the in-tree
toolchain the Makefile built, which is the checksum of sdcc/ and so
changes with every patch in it. A build with CC given on the command
line says "system" instead, since that compiler need not carry the
patches. A plain release and the same release with the patches report
the same revision, so the toolchain line is what tells them apart.

Costs 66 bytes of BANK2.
2026-10-25 16:04:49 +01:00
feelfree69 26c420d26a Merge pull request #701 from hlyi/PSW8_25MG
Add REALHD_PSW8_25MG support and makefile enhancement
2026-10-25 15:52:26 +01:00
HL Yi eb394af95f add REALHD_PSW8_25MG support 2026-10-25 09:11:35 -05:00
feelfree69 4a4caeffd7 Merge pull request #703 from hlyi/make-chg
makefile enhancement for machine build
2026-10-25 14:37:47 +01:00
HL Yi 391360f517 makefile enhancement that only when both .h and .c exist to be considered as a device. It allows generic pcb-specific c not listed as a device 2026-10-25 06:21:45 -05:00
feelfree69 ed8e4b1a56 Merge pull request #560 from brunoz78/multi-session
httpd: four login sessions instead of one
2026-10-25 11:52:56 +01:00
feelfree69 78f28488c1 Merge pull request #534 from DrDoof/fix/html-min-stamp
build: minify the web files only when they change
2026-10-25 11:48:16 +01:00
Brunoz78andClaude Sonnet 5.5 e1c79ec4cd httpd: reuse the slot of a valid cookie, end sessions on passwd
Review feedback on #560 (DrDoof):

- A login that came with a cookie that is still valid took a second
  slot. The first one looked fresh, so the next login could push out
  someone who is using the switch. The slot of the cookie now gets the
  new id.
- Changing the password leaves no old login valid: session_init() from
  parse_passwd(). With one session the next login pushed a leftover one
  out, with several it would stay valid until the next restart.
- The 32-bit comparison of the last use times moves into a leaf function,
  so the compiler does not give it a 4-byte scratch in internal RAM.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 10:51:23 +01:00
Brunoz78andClaude Opus 5.5 a7db0ca8b6 httpd: keep the login sessions in bank 3
The web server's bank had no room left for the four sessions once the
original firmware's more robust header handling came in. Picking a slot,
checking a cookie and starting a session move to sessions.c in bank 3;
httpd.c only calls session_init(), session_check() and session_new().
The random id is written straight into the reply, which drops
gen_random_hex_chars() from bank 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:51:05 +01:00
Claude 70f59b64f5 httpd: four login sessions instead of one
Logging in from a second browser ended the first one's session at its next
request: two browsers open on the switch logged each other out every few
seconds. Up to four sessions now, each with its own cookie and expiry; a
fifth login replaces the least recently used. The expiry check is a leaf
function so its 32-bit scratch stays out of internal RAM (stack still
159 bytes with HEALTH).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tx2W7xVecMoKbBCkD2i8PG
(cherry picked from commit 03330f4077ef8872d861d951c8e44ece3c573935)
2026-10-25 10:51:05 +01:00
feelfree69 f0cbaba7b1 Merge pull request #672 from dobodu/main
French translation update
2026-10-25 10:20:24 +01:00
Rob Emery 2d5424fedc Fixing double firing of load vlan 1 when the tab is loaded 2026-10-25 09:06:30 +00:00
Rob Emery 23c8b2a8b3 Fixing the unsaved changes not appearing. Previously if a set of
changes were sent as a single cmd using \n separation then the
dirty regex would skip it as $ wouldn't match \n. with /m modifier
the regex will match
2026-10-25 09:06:30 +00:00
Rob Emery c9f6362da5 Previously the vlan 2 regex was assuming there were ports, now
it'll accept just the definition.
Also throughout the regex we have over-specified the number of digits
sometimes ports are 4 digits long, sometimes they are 2. This seems
unnecessary, 1 or more is sufficient
2026-10-25 09:06:30 +00:00
Rob Emery 742aef5461 Adding highlighting to the currently selected VLAN in the top table
so that it is more clear it is selected
2026-10-25 09:06:30 +00:00
Rob Emery a77d219baf Moving the mgmt switch into the bottom section so it applies when
the user clicks apply on the specific vlan. In order for this to
work when the user is simultaneously changing the vlan that their
machine is connected through and the mgmt vlan id, we need to be
able to send a batch of commands through to the switch atomically
so the switch can process all of them and the momentary disconnection
of the machine doesn't matter
2026-10-25 09:06:30 +00:00
Rob Emery f94204e56f Adding rename support for vlan 2026-10-25 09:06:30 +00:00
Rob Emery 8d6adedb56 Removing my changes to the sim, in favour of #629 2026-10-25 09:06:30 +00:00
Rob Emery c3f9acea10 Tidying up the new VLAN page and adding error messages
When adding a new VLAN, we should load it after addition
Prevent deleting the mgmt vlan
Adding a button to promote a vlan to be the management VLAN
We can't create a vlan called d or mgmt as that clashes with the
commands to delete and promote a vlan
Making the Management VLAN more obvious and adding a "confused"
disabled button to where delete and promote are
Switching to the i image and making it so you can click the entire
row apart from the cell where the buttons are (to prevent accidents)
Cleaning up the last bits of ingress filtering I can see
2026-10-25 09:06:30 +00:00
Rob Emery c46261e052 Using PVID=0 for the situation where the port is only in tagged
membership. This was tested on HI_K0801WS and it appears to not
have any negative side-effects
2026-10-25 09:06:30 +00:00
Rob Emery 834403b97b Parking ports with only tagged membership into VLAN 4094 for now
I think this should also resolve the work-flow where you can get
a port's PVID and tagged membership to the same vlan
2026-10-25 09:06:30 +00:00
Rob Emery 48087d3520 Decoupling the load from the spinner so we can get rid of it
Also making the first VLAN in the table load when we load the UI

Removing the tickbox for the PVID, I'll swap this out to ticks
or something later on, but the PVID will be automatically set
based on the untagged membership, otherwise it will be 1

Send the vlan with name command when attempting to add a new VLAN
Because of the structure of the vlan command, we need to send the name as well if its set

Set the PVID based on the untagged membership and reload the
table when applied. We need to block setting the PVID to the tagged by proxy

Blue button

Need to provide array of pvid commands not concat
Storing state of each vlan so we can refer later

Blue button
2026-10-25 09:06:30 +00:00
Rob Emery 1d359afba5 Adding vlanlist support into http_sim so it's easier to work on
Also improving vlan.json to mirror the real output
2026-10-25 09:06:30 +00:00
logicog a18c334139 Merge pull request #649 from DrDoof/build/sdcc-in-tree
build: build SDCC 4.6.0 with the mcs51 fixes in the tree
2026-10-25 06:18:24 +01:00
DrDoof 337b171ac4 build: minify the web files only when they change
html_min was phony, so every make deleted output/html_min and minified
all of html/ again, even with nothing changed. A stamp file now stands for
the minified copy and depends on the sources and on minify.py. A list of
the source names, rewritten only when it changes, is a dependency too, so
adding or removing a file in html/ still redoes the copy and a removed
file does not stay behind in the image. If output/html_min is missing,
the stamp is remade in the same run.

The note on version.h in webui-compression.md still said it was phony.
2026-10-25 03:11:03 +01:00
d00f 53eb3f5486 Merge pull request #583 from avicarmeli/fix/cpu-vlan-init
Fix CPU port PVID initialization independent of user port range
2026-10-25 02:44:18 +01:00
d00f 241edfdbda test: every last byte, CR runs and broken matches through the upload
Three more bench scenarios around the closing boundary. Every value
of the last image byte, uploaded whole and split right after the
payload, must end the part. A run of CR before the boundary of even
length passed before the fix and an odd one did not, so both are
checked. An image made of CR only, longer than a flash page, and one
made of repeated "\r\n-" exercise the broken matches back to back:
each one appends to the page buffer without a byte written, and the
page flush after both paths has to keep up.
2026-10-25 02:49:21 +02:00
DrDoof 714c9eb343 httpd: re-check the byte that breaks a partial boundary match
stream_upload() matches the closing multipart boundary byte by byte.
When a byte breaks a partial match, the matched prefix goes to flash as
data, and so does the breaking byte, without being compared against the
start of the boundary.

The boundary starts with "\r\n--", so an image whose last byte is '\r'
never completes: that '\r' starts a match, the '\r' of the boundary
breaks it and is written as data, and the rest of the boundary no
longer matches. The browser waits for a reply that never comes.

Flush the matched prefix and look at the breaking byte again from the
start of the boundary. A boundary may not contain CR, so no longer
suffix of the matched prefix can start a new match.
2026-10-25 02:49:14 +02:00
feelfree69 f2c89fd75b Merge pull request #651 from Kamikaze94/bugfix/sidebar-scrolling
WebUI: Lock sidebar layout and move scrolling to main element
2026-10-25 00:21:08 +02:00
avicarmeli ca2f1d101d Merge upstream main into CPU VLAN fix 2026-10-24 23:38:25 +03:00
d00f 9cc859ad30 build: carry the sdas fix for SDCC bug 4070
The 8051 assembler sign-extends every value to 24 bits, so the top
byte of a __sfr32 address list like 0xa4a5a6a7 comes out as 0xff.
The patch keeps 32-bit arithmetic while leaving the 24-bit T line
addresses alone, so the relocations are unchanged. Proposed upstream
in the bug thread. With it SFR_DATA_U32 can be used again, which
saves about 240 bytes of code in REG_SET.
2026-10-24 21:59:37 +02:00
d00f 0181276ec6 ci: build the in-tree SDCC and keep it between runs
The workflow and the Dockerfile install what building SDCC needs instead
of the distribution's sdcc, and the workflow caches toolchain/ keyed on
the contents of sdcc/.
2026-10-24 21:59:37 +02:00
d00f 905e588071 build: build SDCC 4.6.0 with two mcs51 fixes in the tree
Released SDCC 4.5.0 and 4.6.0 miscompile some of our code in the mcs51
register allocator (SDCC bugs 4153 and 4154, fixed in trunk r17025 and
r17039). The first make now downloads the 4.6.0 sources, checks their
sha256, applies the two fixes from sdcc/ and installs the compiler into
toolchain/, named after a checksum of sdcc/, so a changed patch builds a
new one. make CC=sdcc still uses an installed compiler.
2026-10-24 21:58:46 +02:00
feelfree69 bb16302a80 Merge pull request #622 from bloqaudio/fix/port-counter-lines
web: give each packet counter of a port its own line
2026-10-24 19:56:44 +02:00
feelfree69 50fda40fd9 Merge pull request #584 from bloqaudio/fix/mirror-status
mirror: show the configured monitor port in "mirror status"
2026-10-24 19:54:44 +02:00
feelfree69 9c65039bab Merge pull request #623 from bloqaudio/fix/save-button-dirty
web: highlight Save to flash only when there are unsaved changes
2026-10-24 19:39:55 +02:00
feelfree69 7e0bc93b55 Merge pull request #503 from bloqaudio/fix/uip-fragment-log-rate-limit
uip: rate-limit the dropped-fragment log
2026-10-24 16:40:33 +02:00