fxmac_sinit.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright : (C) 2022 Phytium Information Technology, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is OPEN SOURCE software: you can redistribute it and/or modify it
  6. * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
  7. * either version 1.0 of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
  10. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. * See the Phytium Public License for more details.
  12. *
  13. *
  14. * FilePath: fxmac_sinit.c
  15. * Date: 2022-04-06 14:46:52
  16. * LastEditTime: 2022-04-06 14:46:58
  17. * Description:  This file is for
  18. *
  19. * Modify History:
  20. * Ver   Who        Date         Changes
  21. * ----- ------     --------    --------------------------------------
  22. */
  23. #include "fxmac.h"
  24. #include "fparameters.h"
  25. extern const FXmacConfig fxmac_cfg_tbl[FT_XMAC_NUM];
  26. const FXmacConfig *FXmacLookupConfig(u32 instance_id)
  27. {
  28. const FXmacConfig *cfg_ptr = NULL;
  29. u32 index;
  30. for (index = 0; index < (u32)FT_XMAC_NUM; index++)
  31. {
  32. if (fxmac_cfg_tbl[index].instance_id == instance_id)
  33. {
  34. cfg_ptr = &fxmac_cfg_tbl[index];
  35. break;
  36. }
  37. }
  38. return (const FXmacConfig *)cfg_ptr;
  39. }