Merge branch 'master' into ozonet
authorAlexandros Couloumbis <alex@ozo.com>
Sun, 20 Sep 2020 10:36:54 +0000 (13:36 +0300)
committerAlexandros Couloumbis <alex@ozo.com>
Sun, 20 Sep 2020 10:36:54 +0000 (13:36 +0300)
1  2 
package/kernel/linux/modules/netdevices.mk
package/kernel/linux/modules/other.mk
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c

Simple merge
index 105f6527b8867b9aa642463375497784a25d3ccb,281175bae74ebb11981afea2d8672874abe34b6a..d5e087e0e8500ddf76fbaba588a11f7c4af1b423
@@@ -322,13 -316,60 +322,62 @@@ static const struct of_device_id mtdspl
  static struct mtd_part_parser uimage_netgear_parser = {
        .owner = THIS_MODULE,
        .name = "netgear-fw",
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
        .of_match_table = mtdsplit_uimage_netgear_of_match_table,
 +#endif
        .parse_fn = mtdsplit_uimage_parse_netgear,
        .type = MTD_PARSER_TYPE_FIRMWARE,
+ };
+ /**************************************************
+  * ALLNET
+  **************************************************/
+ #define FW_MAGIC_SG8208M      0x00000006
+ #define FW_MAGIC_SG8310PM     0x83000006
+ static ssize_t uimage_verify_allnet(u_char *buf, size_t len, int *extralen)
+ {
+       struct uimage_header *header = (struct uimage_header *)buf;
+       switch (be32_to_cpu(header->ih_magic)) {
+       case FW_MAGIC_SG8208M:
+       case FW_MAGIC_SG8310PM:
+               break;
+       default:
+               return -EINVAL;
+       }
+       if (header->ih_os != IH_OS_LINUX)
+               return -EINVAL;
+       return 0;
+ }
+ static int
+ mtdsplit_uimage_parse_allnet(struct mtd_info *master,
+                             const struct mtd_partition **pparts,
+                             struct mtd_part_parser_data *data)
+ {
+       return __mtdsplit_parse_uimage(master, pparts, data,
+                                     uimage_verify_allnet);
+ }
+ static const struct of_device_id mtdsplit_uimage_allnet_of_match_table[] = {
+       { .compatible = "allnet,uimage" },
+       {},
  };
  
+ static struct mtd_part_parser uimage_allnet_parser = {
+       .owner = THIS_MODULE,
+       .name = "allnet-fw",
+       .of_match_table = mtdsplit_uimage_allnet_of_match_table,
+       .parse_fn = mtdsplit_uimage_parse_allnet,
+ };
  /**************************************************
   * Edimax
   **************************************************/