tuxsavvy / agere_fw_utils (public) (License: Dual BSD 3-clause and GPLv2) (since 2021-02-07) (hash sha1)
Personal fork of https://repo.or.cz/agere_fw_utils.git
List of commits:
Subject Hash Author Date (UTC)
Allow dump_fw to build against wl_lkm_722 for h2 and h25 fw. bc458b38b8a200f47f3119e406920334334512a8 David Kilroy 2008-10-26 21:35:13
Write compatibility info from dump_fw. Update README 8295b468312cd3475c06645e92ef4884c2a3dbcc David Kilroy 2008-10-26 14:46:55
Further refactorring. Also pass through splint and indent. 29e550703e7ef9b083b22d11c3bb470ff54b6ab0 David Kilroy 2008-10-26 14:44:25
Convert primary plugdata properly 933f77d11ca6645df705c4b71c471aa670fccaf3 David Kilroy 2008-10-26 14:39:28
Convert AirPort firmware version 1f31f74c58179b099005ae939eff9bb467317b5b David Kilroy 2008-10-26 14:37:57
Mach-O parsing from Dan Williams 525f9168679392920da51d2487cc5fdba3c68e2c David Kilroy 2008-10-26 14:34:59
Check if we are in wl_lkm tree and build appropriately 4af298b374a1dea172b57acbd080773912d22087 David Kilroy 2008-10-26 14:30:33
Use C99 types 11362c209f9ec7369931b9a25a407c21476c48e4 David Kilroy 2008-10-26 14:30:03
hfwget refactorring posted as hfwget2 April 2008 9b77acdf3330592acda5261d282c579cc1497637 David Kilroy 2008-10-26 14:27:32
dump_fw and hfwget posted Sep 2007 77d205076542510222c6e8359bb2647b0d4e0873 David Kilroy 2008-10-26 14:22:02
Add hfwget.c from hermesap-0.2 9239c21487b524cf0f87b4ffa4828793713fbecd David Kilroy 2008-10-26 14:20:38
dump_fw posted June 2007 617a0ae960430d0d93a533ac5dffc7b9c07a777a David Kilroy 2008-10-26 14:19:45
Commit bc458b38b8a200f47f3119e406920334334512a8 - Allow dump_fw to build against wl_lkm_722 for h2 and h25 fw.
Author: David Kilroy
Author date (UTC): 2008-10-26 21:35
Committer name: David Kilroy
Committer date (UTC): 2008-10-26 21:39
Parent(s): 8295b468312cd3475c06645e92ef4884c2a3dbcc
Signing key:
Tree: 4a5165d0e7d432ee4510dc7656e547fbe98530c5
File Lines added Lines deleted
README.dump_fw 1 2
dump_fw.c 26 4
dump_fw.mk 49 11
File README.dump_fw changed (mode: 100644) (index c5208c9..5b729e0)
... ... To use the programs just do:
27 27
28 28 Which will produce <root>_ap_fw.bin and <root>_sta_fw.bin. Which will produce <root>_ap_fw.bin and <root>_sta_fw.bin.
29 29
30 If you want to use the wl_lkm_714 source tree instead, you can. See
30 You can use the wl_lkm_714 or wl_lkm_722 source tree instead. See
31 31 instructions in dump_fw.mk instructions in dump_fw.mk
32 32
33 33 KNOWN BUGS KNOWN BUGS
 
... ... KNOWN BUGS
35 35
36 36 N/A N/A
37 37
38
39 38
40 39 hfwget hfwget
41 40 ------ ------
File dump_fw.c changed (mode: 100644) (index 9b099a3..67e389b)
... ... void dump_compat(FILE *f, CFG_RANGE20_STRCT *c)
368 368
369 369 void dump_image(FILE* f, memimage *image) void dump_image(FILE* f, memimage *image)
370 370 { {
371 #if __wl_lkm < 722
372 #define PDA pdaplug
373 #define PRI priplug
374 #else
375 #define PDA place_holder_1
376 #define PRI place_holder_2
377 #endif
371 378 u32 image_header[6]; u32 image_header[6];
372 379 u32 blocks = count_blocks(image); u32 blocks = count_blocks(image);
373 380 u32 blk_offset = 0; /* Immediately after header */ u32 blk_offset = 0; /* Immediately after header */
374 381 u32 pdr_offset = (acc_block_size(image) + u32 pdr_offset = (acc_block_size(image) +
375 382 ((blocks + 1) * (sizeof(u32) + sizeof(u16)))); ((blocks + 1) * (sizeof(u32) + sizeof(u16))));
376 383 u32 pri_offset = pdr_offset + u32 pri_offset = pdr_offset +
377 ((count_pdr(image->pdaplug) + 1) * sizeof(u32) * 3);
384 ((count_pdr(image->PDA) + 1) * sizeof(u32) * 3);
378 385 u32 cpt_offset = pri_offset + u32 cpt_offset = pri_offset +
379 ((count_pdr(image->priplug) + 1) * sizeof(u32) * 3);
386 ((count_pdr(image->PRI) + 1) * sizeof(u32) * 3);
380 387 u16 headersize = ((sizeof(VERSION)-1) + u16 headersize = ((sizeof(VERSION)-1) +
381 388 sizeof(u16) + sizeof(u16) +
382 389 (sizeof(u32)*6) (sizeof(u32)*6)
 
... ... void dump_image(FILE* f, memimage *image)
407 414 #endif #endif
408 415
409 416 dump_blocks(f, image); dump_blocks(f, image);
410 dump_pdr(f, image->pdaplug);
411 dump_pdr(f, image->priplug);
417 dump_pdr(f, image->PDA);
418 dump_pdr(f, image->PRI);
412 419 dump_compat(f, image->compat); dump_compat(f, image->compat);
413 420
414 421 return; return;
415 422 } }
416 423
424 #if __wl_lkm < 722
417 425 extern memimage ap; extern memimage ap;
418 426 extern memimage station; extern memimage station;
427 #else
428 extern memimage fw_image;
429 #define ap fw_image
430 #define station fw_image
431 #endif
419 432
420 433 int main (int argc, char** argv) int main (int argc, char** argv)
421 434 { {
 
... ... int main (int argc, char** argv)
438 451 check_endianess(); check_endianess();
439 452
440 453 len = strlen(argv[1]); len = strlen(argv[1]);
454
455 if (ap.identity->comp_id != COMP_ID_FW_AP)
456 goto sta;
457
441 458 ap_filename = malloc(len + sizeof(AP_SUFFIX) + 1); ap_filename = malloc(len + sizeof(AP_SUFFIX) + 1);
442 459 if (!ap_filename) if (!ap_filename)
443 460 { {
 
... ... int main (int argc, char** argv)
462 479 } }
463 480 free(ap_filename); free(ap_filename);
464 481
482 sta:
483 if (station.identity->comp_id != COMP_ID_FW_STA)
484 goto out;
485
465 486 sta_filename = malloc(len + sizeof(STA_SUFFIX) + 1); sta_filename = malloc(len + sizeof(STA_SUFFIX) + 1);
466 487 if (!sta_filename) if (!sta_filename)
467 488 { {
 
... ... int main (int argc, char** argv)
486 507 } }
487 508 free(sta_filename); free(sta_filename);
488 509
510 out:
489 511 return rc; return rc;
490 512 } }
File dump_fw.mk changed (mode: 100644) (index b397f2c..d0de496)
5 5 # NOTE if compiling wl_lkm_714: # NOTE if compiling wl_lkm_714:
6 6 # - the firmware files need to be modified to include "mmd.h" instead of "..\hcf\mmd.h" # - the firmware files need to be modified to include "mmd.h" instead of "..\hcf\mmd.h"
7 7 # - include/hcf/hcfcfg.h line 775 should be commented out # - include/hcf/hcfcfg.h line 775 should be commented out
8 # - select the appropriate DIR_FW and LKM_CFLAGS values below
8 # - set LKM on next line to 714 718 or 722
9 LKM=718
10
11 ifeq ($(LKM),714)
12 DIR_FW := dhf
13 LKM_CFLAGS = -D__wl_lkm=714
14 endif
15 ifeq ($(LKM),718)
16 DIR_FW := firmware
17 LKM_CFLAGS := -DHCF_DLV -D__wl_lkm=718
18 endif
19 ifeq ($(LKM),722)
20 DIR_FW :=hcf
21 LKM_CFLAGS := -D__wl_lkm=722
22 endif
9 23
10 24 DIR_HCF := hcf DIR_HCF := hcf
11 25 DIR_DHF := dhf DIR_DHF := dhf
12 # 714 firmware is in
13 #DIR_FW = dhf
14 # 718 firmware is in
15 DIR_FW := firmware
16 26 DIR_CONFIG := include/hcf DIR_CONFIG := include/hcf
17 27 DIR_WIRELESS := include/wireless DIR_WIRELESS := include/wireless
18 28
19 29 OBJS := dump_fw.o OBJS := dump_fw.o
20 30
21 31 CFLAGS := -O3 -Wall -Wstrict-prototypes -pipe CFLAGS := -O3 -Wall -Wstrict-prototypes -pipe
22 # CFLAGS for wl_lkm_714
23 #LKM_CFLAGS = -D__wl_lkm=714
24 # CFLAGS for wl_lkm_718
25 LKM_CFLAGS := -DHCF_DLV -D__wl_lkm=718
26 32 CPPFLAGS := CPPFLAGS :=
27 33 CC := gcc -I$(DIR_CONFIG) -I$(DIR_HCF) -I$(DIR_DHF) CC := gcc -I$(DIR_CONFIG) -I$(DIR_HCF) -I$(DIR_DHF)
28 34
35 H25_OBJS := $(DIR_FW)/ap_h25.o $(DIR_FW)/sta_h25.o
36
29 37 H2_OBJS := $(DIR_FW)/ap_h2.o $(DIR_FW)/sta_h2.o H2_OBJS := $(DIR_FW)/ap_h2.o $(DIR_FW)/sta_h2.o
30 38 H2_CFLAGS := -DHCF_TYPE=4 H2_CFLAGS := -DHCF_TYPE=4
31 39
 
... ... ifneq (,$(findstring $(DIR_FW),$(wildcard $(DIR_FW))))
43 51 endif endif
44 52
45 53 ifeq ($(IN_ROOT),y) ifeq ($(IN_ROOT),y)
46 TARGETS+=dump_h1_fw dump_h2_fw
54 ifneq ($(LKM),722)
55 TARGETS+=dump_h1_fw dump_h2_fw
56 else
57 TARGETS+=dump_h2_sta_fw dump_h2_ap_fw
58 TARGETS+=dump_h25_sta_fw dump_h25_ap_fw
59 endif
47 60 else else
48 61 $(info Info: Not in wl_lkm directory, so not building wl_lkm dumpers) $(info Info: Not in wl_lkm directory, so not building wl_lkm dumpers)
49 62 endif endif
50 63
51 64 all: $(TARGETS) all: $(TARGETS)
52 65
66 ifneq ($(LKM),722)
53 67 dump_h1_fw : CFLAGS+= $(LKM_CFLAGS) $(H1_CFLAGS) dump_h1_fw : CFLAGS+= $(LKM_CFLAGS) $(H1_CFLAGS)
54 68 dump_h1_fw : $(OBJS) $(H1_OBJS) dump_h1_fw : $(OBJS) $(H1_OBJS)
55 69 gcc $(CFLAGS) $^ -o $@ gcc $(CFLAGS) $^ -o $@
 
... ... dump_h2_fw : CFLAGS+= $(LKM_CFLAGS) $(H2_CFLAGS)
58 72 dump_h2_fw : $(OBJS) $(H2_OBJS) dump_h2_fw : $(OBJS) $(H2_OBJS)
59 73 gcc $(CFLAGS) $^ -o $@ gcc $(CFLAGS) $^ -o $@
60 74
75 else
76 $(DIR_HCF)/ap_h%.c : $(DIR_HCF)/fw_h%.c.ap
77 cp $^ $@
78
79 $(DIR_HCF)/sta_h%.c : $(DIR_HCF)/fw_h%.c.sta
80 cp $^ $@
81
82 dump_h2_ap_fw : CFLAGS+= $(LKM_CFLAGS)
83 dump_h2_ap_fw : $(OBJS) $(DIR_HCF)/ap_h2.o
84 gcc $(CFLAGS) $^ -o $@
85
86 dump_h2_sta_fw : CFLAGS+= $(LKM_CFLAGS)
87 dump_h2_sta_fw : $(OBJS) $(DIR_HCF)/sta_h2.o
88 gcc $(CFLAGS) $^ -o $@
89
90 dump_h25_ap_fw : CFLAGS+= $(LKM_CFLAGS)
91 dump_h25_ap_fw : $(OBJS) $(DIR_HCF)/ap_h25.o
92 gcc $(CFLAGS) $^ -o $@
93
94 dump_h25_sta_fw : CFLAGS+= $(LKM_CFLAGS)
95 dump_h25_sta_fw : $(OBJS) $(DIR_HCF)/sta_h25.o
96 gcc $(CFLAGS) $^ -o $@
97 endif
98
61 99 hfwget : hfwget.c hfwget : hfwget.c
62 100 gcc $(CFLAGS) $^ -o $@ gcc $(CFLAGS) $^ -o $@
63 101
64 102 clean : clean :
65 rm $(TARGETS) $(OBJS) $(H1_OBJS) $(H2_OBJS)
103 rm $(TARGETS) $(OBJS) $(H1_OBJS) $(H2_OBJS) $(H25_OBJS)
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/tuxsavvy/agere_fw_utils

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/tuxsavvy/agere_fw_utils

Clone this repository using git:
git clone git://git.rocketgit.com/user/tuxsavvy/agere_fw_utils

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main