[PATCH] [iwinfo] devices: add device id for Atheros AR9287 and AR9380

2023-05-22 Thread yangshiji66
From: Shiji Yang 

Atheros AR9287 is a 2*2 PCI wireless chip used in TP-Link TL-WR841N v7.
Atheros AR9380 is a 3*3 PCI wireless chip used in TP-Link TL-WR2543N v1.

Signed-off-by: Shiji Yang 
---
 devices.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/devices.txt b/devices.txt
index 5f0b369..3f28446 100644
--- a/devices.txt
+++ b/devices.txt
@@ -149,6 +149,8 @@
 0x168c 0x002e 0x1a3b 0x11210  0  "Atheros"  "AR9287"
 0x168c 0x002e 0x0777 0xe0a28  0  "Ubiquiti" "NanoStation Loco M2 (XM)" 
/* wrong offset! */
 0x168c 0x002e 0x168c 0x30a40  0  "Atheros"  "AR9287"
+0x168c 0x002e 0x168c 0xa1990  0  "Atheros"  "AR9287"
+0x168c 0x0030 0x168c 0x31120  0  "Atheros"  "AR9380"
 0x168c 0x0030 0x168c 0x31140  0  "Atheros"  "AR9390"
 0x168c 0x0033 0x168c 0xa1200  0  "Atheros"  "AR9580"
 0x168c 0x0033 0x168c 0xa1360  0  "Atheros"  "AR9580"
-- 
2.30.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] firmware-utils: new package replacing otrx

2023-05-22 Thread Rafał Miłecki
From: Rafał Miłecki 

Some of firmware utils may be required on target devices. It's useful
e.g. for dealing with some firmware formats. That is often required
(supporting specific format) to provide an option to revert to original
firmware.

So far we had packaged "otrx" util only for use on Broadcom targets.
Refactor that to package the whole firmware-utils project so we can
package any single util needed.

Signed-off-by: Rafał Miłecki 
---
 package/utils/firmware-utils/Makefile | 31 ++
 package/utils/otrx/Makefile   | 46 ---
 2 files changed, 31 insertions(+), 46 deletions(-)
 create mode 100644 package/utils/firmware-utils/Makefile
 delete mode 100644 package/utils/otrx/Makefile

diff --git a/package/utils/firmware-utils/Makefile 
b/package/utils/firmware-utils/Makefile
new file mode 100644
index 00..78cbea4bd1
--- /dev/null
+++ b/package/utils/firmware-utils/Makefile
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=firmware-utils
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
+PKG_SOURCE_DATE:=2023-05-18
+PKG_SOURCE_VERSION:=02cdbc6a4d61605c008efef09162f772f553fcde
+PKG_MIRROR_HASH:=f5188fc38bb03ddbcc34763ff049597e2d8af98c0854910dc87f10e5927096e2
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/default
+  SECTION:=utils
+  CATEGORY:=Base system
+  TITLE:=Firmware utility $(1)
+  DEPENDS:=$(2)
+endef
+
+Package/otrx = $(call Package/default,otrx,@(TARGET_bcm47xx||TARGET_bcm53xx))
+
+define Package/otrx/install
+   $(INSTALL_DIR) $(1)/usr/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/otrx $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,otrx))
diff --git a/package/utils/otrx/Makefile b/package/utils/otrx/Makefile
deleted file mode 100644
index 35c59e2730..00
--- a/package/utils/otrx/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2015 Rafał Miłecki 
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=otrx
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
-PKG_SOURCE_DATE:=2021-12-02
-PKG_SOURCE_VERSION:=56e8e19151743c923f48604c457850cf8eb52076
-PKG_MIRROR_HASH:=2a40ac73e8eab0a7a4474cb331b8e2fc972635314b0b5e02a9f2b9a32c5d5f3b
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/otrx
-  SECTION:=utils
-  CATEGORY:=Base system
-  TITLE:=Utility for opening (analyzing) TRX firmware images
-  MAINTAINER:=Rafał Miłecki 
-  DEPENDS:=@(TARGET_bcm47xx||TARGET_bcm53xx)
-endef
-
-define Package/otrx/description
- This package contains an utility that allows validating TRX images.
-endef
-
-TARGET_CFLAGS += -Wall
-
-define Build/Compile
-   $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
-   -o $(PKG_BUILD_DIR)/otrx \
-   $(PKG_BUILD_DIR)/src/otrx.c
-endef
-
-define Package/otrx/install
-   $(INSTALL_DIR) $(1)/usr/bin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/otrx $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,otrx))
-- 
2.35.3


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] firmware-utils: package oseama

2023-05-22 Thread Rafał Miłecki
From: Rafał Miłecki 

It's required by bcm53xx. This allows dropping separated oseama package
and avoids some code duplication.

Signed-off-by: Rafał Miłecki 
---
 package/utils/firmware-utils/Makefile |   8 +
 package/utils/oseama/Makefile |  40 --
 package/utils/oseama/src/Makefile |   7 -
 package/utils/oseama/src/md5.c| 296 --
 package/utils/oseama/src/md5.h|  45 ---
 package/utils/oseama/src/oseama.c | 556 --
 6 files changed, 8 insertions(+), 944 deletions(-)
 delete mode 100644 package/utils/oseama/Makefile
 delete mode 100644 package/utils/oseama/src/Makefile
 delete mode 100644 package/utils/oseama/src/md5.c
 delete mode 100644 package/utils/oseama/src/md5.h
 delete mode 100644 package/utils/oseama/src/oseama.c

diff --git a/package/utils/firmware-utils/Makefile 
b/package/utils/firmware-utils/Makefile
index 78cbea4bd1..f49cca01bb 100644
--- a/package/utils/firmware-utils/Makefile
+++ b/package/utils/firmware-utils/Makefile
@@ -21,6 +21,13 @@ define Package/default
   DEPENDS:=$(2)
 endef
 
+Package/oseama = $(call Package/default,oseama,@TARGET_bcm53xx)
+
+define Package/oseama/install
+   $(INSTALL_DIR) $(1)/usr/bin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/oseama $(1)/usr/bin/
+endef
+
 Package/otrx = $(call Package/default,otrx,@(TARGET_bcm47xx||TARGET_bcm53xx))
 
 define Package/otrx/install
@@ -28,4 +35,5 @@ define Package/otrx/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/otrx $(1)/usr/bin/
 endef
 
+$(eval $(call BuildPackage,oseama))
 $(eval $(call BuildPackage,otrx))
diff --git a/package/utils/oseama/Makefile b/package/utils/oseama/Makefile
deleted file mode 100644
index 7d9303b92d..00
--- a/package/utils/oseama/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2016 Rafał Miłecki 
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=oseama
-PKG_RELEASE:=1
-
-PKG_FLAGS:=nonshared
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/oseama
-  SECTION:=utils
-  CATEGORY:=Base system
-  TITLE:=Utility for handling Seama firmware images
-  MAINTAINER:=Rafał Miłecki 
-  DEPENDS:=@TARGET_bcm53xx
-endef
-
-define Package/oseama/description
- This package contains an utility that allows handling Seama images.
-endef
-
-define Build/Compile
-   $(MAKE) -C $(PKG_BUILD_DIR) \
-   CC="$(TARGET_CC)" \
-   CFLAGS="$(TARGET_CFLAGS) -Wall"
-endef
-
-define Package/oseama/install
-   $(INSTALL_DIR) $(1)/usr/bin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/oseama $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,oseama))
diff --git a/package/utils/oseama/src/Makefile 
b/package/utils/oseama/src/Makefile
deleted file mode 100644
index ca35e6ee99..00
--- a/package/utils/oseama/src/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all: oseama
-
-oseama:
-   $(CC) $(CFLAGS) -Wall oseama.c md5.c -o $@ $^
-
-clean:
-   rm -f oseama
diff --git a/package/utils/oseama/src/md5.c b/package/utils/oseama/src/md5.c
deleted file mode 100644
index 52d96accd3..00
--- a/package/utils/oseama/src/md5.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
- * MD5 Message-Digest Algorithm (RFC 1321).
- *
- * Homepage:
- * 
http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
- *
- * Author:
- * Alexander Peslyak, better known as Solar Designer 
- *
- * This software was written by Alexander Peslyak in 2001.  No copyright is
- * claimed, and the software is hereby placed in the public domain.
- * In case this attempt to disclaim copyright and place the software in the
- * public domain is deemed null and void, then the software is
- * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
- * general public under the following terms:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted.
- *
- * There's ABSOLUTELY NO WARRANTY, express or implied.
- *
- * (This is a heavily cut-down "BSD license".)
- *
- * This differs from Colin Plumb's older public domain implementation in that
- * no exactly 32-bit integer data type is required (any 32-bit or wider
- * unsigned integer data type will do), there's no compile-time endianness
- * configuration, and the function prototypes match OpenSSL's.  No code from
- * Colin Plumb's implementation has been reused; this comment merely compares
- * the properties of the two independent implementations.
- *
- * The primary goals of this implementation are portability and ease of use.
- * It is meant to be fast, but not as fast as possible.  Some known
- * optimizations are not included to reduce source code size and avoid
- * compile-time configuration.
- */
-
-#ifndef HAVE_OPENSSL
-
-#include 
-
-#include "md5.h"
-
-/*
- * The basic MD5 functions.
- *
- * F and G are optimized compared to their RFC